File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
packages/react-reconciler/src Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -269,6 +269,7 @@ import {
269269 startYieldTimer ,
270270 yieldStartTime ,
271271 yieldReason ,
272+ startPingTimerByLanes ,
272273} from './ReactProfilerTimer' ;
273274import { setCurrentTrackFromLanes } from './ReactFiberPerformanceTrack' ;
274275
@@ -3961,6 +3962,10 @@ function pingSuspendedRoot(
39613962
39623963 markRootPinged ( root , pingedLanes ) ;
39633964
3965+ if ( enableProfilerTimer && enableComponentPerformanceTrack ) {
3966+ startPingTimerByLanes ( pingedLanes ) ;
3967+ }
3968+
39643969 warnIfSuspenseResolutionNotWrappedWithActDEV ( root ) ;
39653970
39663971 if (
Original file line number Diff line number Diff line change @@ -108,6 +108,24 @@ export function startUpdateTimerByLane(lane: Lane): void {
108108 }
109109}
110110
111+ export function startPingTimerByLanes ( lanes : Lanes ) : void {
112+ if ( ! enableProfilerTimer || ! enableComponentPerformanceTrack ) {
113+ return ;
114+ }
115+ // Mark the update time and clamp anything before it because we don't want
116+ // to show the event time for pings but we also don't want to clear it
117+ // because we still need to track if this was a repeat.
118+ if ( includesSyncLane ( lanes ) || includesBlockingLane ( lanes ) ) {
119+ if ( blockingUpdateTime < 0 ) {
120+ blockingClampTime = blockingUpdateTime = now ( ) ;
121+ }
122+ } else if ( includesTransitionLane ( lanes ) ) {
123+ if ( transitionUpdateTime < 0 ) {
124+ transitionClampTime = transitionUpdateTime = now ( ) ;
125+ }
126+ }
127+ }
128+
111129export function trackSuspendedTime ( lanes : Lanes , renderEndTime : number ) {
112130 if ( ! enableProfilerTimer || ! enableComponentPerformanceTrack ) {
113131 return ;
You can’t perform that action at this time.
0 commit comments