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

Function startPingTimerByLanes

packages/react-reconciler/src/ReactProfilerTimer.js:248–274  ·  view source on GitHub ↗
(lanes: Lanes)

Source from the content-addressed store, hash-verified

246}
247
248export function startPingTimerByLanes(lanes: Lanes): void {
249 if (!enableProfilerTimer || !enableComponentPerformanceTrack) {
250 return;
251 }
252 // Mark the update time and clamp anything before it because we don't want
253 // to show the event time for pings but we also don't want to clear it
254 // because we still need to track if this was a repeat.
255 if (isGestureRender(lanes)) {
256 if (gestureUpdateTime < 0) {
257 gestureClampTime = gestureUpdateTime = now();
258 gestureUpdateTask = createTask('Promise Resolved');
259 gestureUpdateType = PINGED_UPDATE;
260 }
261 } else if (includesBlockingLane(lanes)) {
262 if (blockingUpdateTime < 0) {
263 blockingClampTime = blockingUpdateTime = now();
264 blockingUpdateTask = createTask('Promise Resolved');
265 blockingUpdateType = PINGED_UPDATE;
266 }
267 } else if (includesTransitionLane(lanes)) {
268 if (transitionUpdateTime < 0) {
269 transitionClampTime = transitionUpdateTime = now();
270 transitionUpdateTask = createTask('Promise Resolved');
271 transitionUpdateType = PINGED_UPDATE;
272 }
273 }
274}
275
276export function trackSuspendedTime(lanes: Lanes, renderEndTime: number) {
277 if (!enableProfilerTimer || !enableComponentPerformanceTrack) {

Callers 1

pingSuspendedRootFunction · 0.90

Calls 5

isGestureRenderFunction · 0.90
includesBlockingLaneFunction · 0.90
includesTransitionLaneFunction · 0.90
createTaskFunction · 0.85
nowFunction · 0.50

Tested by

no test coverage detected