@@ -278,6 +278,8 @@ impl Application {
278
278
#[ cfg( feature = "integration" ) ]
279
279
let mut idle_handled = false ;
280
280
281
+ let mut iterations: usize = 0 ;
282
+
281
283
loop {
282
284
if self . editor . should_close ( ) {
283
285
return false ;
@@ -301,26 +303,31 @@ impl Application {
301
303
302
304
if last || self . last_render. elapsed( ) > LSP_DEADLINE {
303
305
self . render( ) ;
306
+ iterations = iterations. saturating_add( 1 ) ;
304
307
self . last_render = Instant :: now( ) ;
305
308
}
306
309
}
307
310
Some ( payload) = self . editor. debugger_events. next( ) => {
308
311
let needs_render = self . editor. handle_debugger_message( payload) . await ;
309
312
if needs_render {
310
313
self . render( ) ;
314
+ iterations = iterations. saturating_add( 1 ) ;
311
315
}
312
316
}
313
317
Some ( config_event) = self . editor. config_events. 1 . recv( ) => {
314
318
self . handle_config_events( config_event) ;
315
319
self . render( ) ;
320
+ iterations = iterations. saturating_add( 1 ) ;
316
321
}
317
322
Some ( callback) = self . jobs. futures. next( ) => {
318
323
self . jobs. handle_callback( & mut self . editor, & mut self . compositor, callback) ;
319
324
self . render( ) ;
325
+ iterations = iterations. saturating_add( 1 ) ;
320
326
}
321
327
Some ( callback) = self . jobs. wait_futures. next( ) => {
322
328
self . jobs. handle_callback( & mut self . editor, & mut self . compositor, callback) ;
323
329
self . render( ) ;
330
+ iterations = iterations. saturating_add( 1 ) ;
324
331
}
325
332
_ = & mut self . editor. idle_timer => {
326
333
// idle timeout
@@ -332,6 +339,15 @@ impl Application {
332
339
idle_handled = true ;
333
340
}
334
341
}
342
+ _ = & mut self . editor. frame_timer => {
343
+ log:: warn!( "🏎️: {}" , iterations) ;
344
+ self . editor. frame_timer. as_mut( ) . reset( tokio:: time:: Instant :: now( ) + Duration :: from_secs( 1 ) ) ;
345
+ iterations = 0 ;
346
+ }
347
+ _ = & mut self . editor. immediate_timer => {
348
+ self . render( ) ;
349
+ iterations = iterations. saturating_add( 1 ) ;
350
+ }
335
351
}
336
352
337
353
// for integration tests only, reset the idle timer after every
0 commit comments