File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -115,8 +115,9 @@ export namespace inputLatency {
115115 if ( state . selection !== EventPhase . Finished || state . render !== EventPhase . Finished ) {
116116 return ;
117117 }
118- // Finish the recording, using setImmediate to ensure that layout/paint is captured
119- setImmediate ( ( ) => {
118+ // Finish the recording, use a timer to ensure that layout/paint is captured. setImmediate
119+ // is used if available (Electron) to get slightly more accurate results
120+ ( 'setImmediate' in window ? ( window as any ) . setImmediate : setTimeout ) ( ( ) => {
120121 if ( state . keydown === EventPhase . Finished && state . input === EventPhase . Finished && state . selection === EventPhase . Finished && state . render === EventPhase . Finished ) {
121122 performance . mark ( 'inputlatency/end' ) ;
122123
@@ -142,7 +143,7 @@ export namespace inputLatency {
142143
143144 reset ( ) ;
144145 }
145- } ) ;
146+ } , 0 ) ;
146147 }
147148
148149 /**
You can’t perform that action at this time.
0 commit comments