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 {
115
115
if ( state . selection !== EventPhase . Finished || state . render !== EventPhase . Finished ) {
116
116
return ;
117
117
}
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 ) ( ( ) => {
120
121
if ( state . keydown === EventPhase . Finished && state . input === EventPhase . Finished && state . selection === EventPhase . Finished && state . render === EventPhase . Finished ) {
121
122
performance . mark ( 'inputlatency/end' ) ;
122
123
@@ -142,7 +143,7 @@ export namespace inputLatency {
142
143
143
144
reset ( ) ;
144
145
}
145
- } ) ;
146
+ } , 0 ) ;
146
147
}
147
148
148
149
/**
You can’t perform that action at this time.
0 commit comments