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

Function advanceTaskTime

packages/react-server/src/ReactFlightServer.js:5449–5470  ·  view source on GitHub ↗
(
  request: Request,
  task: Task,
  timestamp: number,
)

Source from the content-addressed store, hash-verified

5447}
5448
5449function advanceTaskTime(
5450 request: Request,
5451 task: Task,
5452 timestamp: number,
5453): void {
5454 if (
5455 !enableProfilerTimer ||
5456 (!enableComponentPerformanceTrack && !enableAsyncDebugInfo)
5457 ) {
5458 return;
5459 }
5460 // Emits a timing chunk, if the new timestamp is higher than the previous timestamp of this task.
5461 if (timestamp > task.time) {
5462 emitTimingChunk(request, task.id, timestamp);
5463 task.time = timestamp;
5464 } else if (!task.timed) {
5465 // If it wasn't timed before, e.g. an outlined object, we need to emit the first timestamp and
5466 // it is now timed.
5467 emitTimingChunk(request, task.id, task.time);
5468 }
5469 task.timed = true;
5470}
5471
5472function markOperationEndTime(request: Request, task: Task, timestamp: number) {
5473 if (

Callers 4

renderFunctionComponentFunction · 0.85
visitAsyncNodeFunction · 0.85
emitAsyncSequenceFunction · 0.85

Calls 1

emitTimingChunkFunction · 0.85

Tested by

no test coverage detected