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

Function markOperationEndTime

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

Source from the content-addressed store, hash-verified

5470}
5471
5472function markOperationEndTime(request: Request, task: Task, timestamp: number) {
5473 if (
5474 !enableProfilerTimer ||
5475 (!enableComponentPerformanceTrack && !enableAsyncDebugInfo)
5476 ) {
5477 return;
5478 }
5479 // This is like advanceTaskTime() but always emits a timing chunk even if it doesn't advance.
5480 // This ensures that the end time of the previous entry isn't implied to be the start of the next one.
5481 if (request.status === ABORTING && timestamp > request.abortTime) {
5482 // If we're aborting then we don't emit any end times that happened after.
5483 return;
5484 }
5485 if (timestamp > task.time) {
5486 emitTimingChunk(request, task.id, timestamp);
5487 task.time = timestamp;
5488 } else {
5489 emitTimingChunk(request, task.id, task.time);
5490 }
5491}
5492
5493function emitChunk(
5494 request: Request,

Callers 6

visitAsyncNodeFunction · 0.85
emitAsyncSequenceFunction · 0.85
forwardDebugInfoFunction · 0.85
erroredTaskFunction · 0.85
retryTaskFunction · 0.85
finishAbortedTaskFunction · 0.85

Calls 1

emitTimingChunkFunction · 0.85

Tested by

no test coverage detected