Commit 6fb3eab 1 parent befc5f9 commit 6fb3eab Copy full SHA for 6fb3eab
File tree 1 file changed +12
-0
lines changed
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,9 @@ static sys_thread_t *callback_thread = 0;
84
84
*/
85
85
static qd_timestamp_t time_base = 0 ;
86
86
87
+ // DEBUG:
88
+ static qd_duration_t max_handler ;
89
+
87
90
ALLOC_DECLARE (qd_timer_t );
88
91
ALLOC_DEFINE (qd_timer_t );
89
92
@@ -292,6 +295,10 @@ void qd_timer_initialize(void)
292
295
void qd_timer_finalize (void )
293
296
{
294
297
sys_mutex_free (& lock );
298
+ if (max_handler ) {
299
+ fprintf (stdout , "MAX TIME=%lld\n" , (long long ) max_handler );
300
+ fflush (0 );
301
+ }
295
302
}
296
303
297
304
@@ -314,7 +321,12 @@ void qd_timer_visit(void)
314
321
* dropped. Attempting to delete the timer now will cause the caller to
315
322
* block until the callback is done.
316
323
*/
324
+ qd_timestamp_t start = qd_timer_now ();
317
325
timer -> handler (timer -> context );
326
+ qd_timestamp_t end = qd_timer_now ();
327
+ if (end - start > max_handler ) {
328
+ max_handler = end - start ;
329
+ }
318
330
319
331
sys_mutex_lock (& lock );
320
332
if (timer -> state == QD_TIMER_STATE_BLOCKED ) {
You can’t perform that action at this time.
0 commit comments