MCPcopy
hub / github.com/facebook/react / markTaskStart

Function markTaskStart

packages/scheduler/src/SchedulerProfiling.js:75–91  ·  view source on GitHub ↗
(
  task: {
    id: number,
    priorityLevel: PriorityLevel,
    ...
  },
  ms: number,
)

Source from the content-addressed store, hash-verified

73}
74
75export function markTaskStart(
76 task: {
77 id: number,
78 priorityLevel: PriorityLevel,
79 ...
80 },
81 ms: number,
82) {
83 if (enableProfiling) {
84 if (eventLog !== null) {
85 // performance.now returns a float, representing milliseconds. When the
86 // event is logged, it's coerced to an int. Convert to microseconds to
87 // maintain extra degrees of precision.
88 logEvent([TaskStartEvent, ms * 1000, task.id, task.priorityLevel]);
89 }
90 }
91}
92
93export function markTaskCompleted(
94 task: {

Callers 4

advanceTimersFunction · 0.90
advanceTimersFunction · 0.90

Calls 1

logEventFunction · 0.70

Tested by

no test coverage detected