debugtimer.c (582B)
1 #include <stdio.h> 2 3 #include "../debug_timer.h" 4 5 int main() { 6 int i; 7 lash_debug_timer_t time; 8 lash_debugTimerReset(&time); 9 for (i=0;i<10;i++) { 10 lash_debugTimerStart(&time); 11 lash_debugTimerStop(&time); 12 } 13 printf("Average: %f\n", lash_debugTimerGetAverage(&time)); 14 for (i=0;i<10;i++) { 15 lash_debugTimerStart(&time); 16 printf("(paused at %li) ", lash_debugTimerPause(&time)); 17 lash_debugTimerPause(&time); 18 printf("(resumed at %li)\n", lash_debugTimerPause(&time)); 19 lash_debugTimerStop(&time); 20 } 21 printf("Average: %f\n", lash_debugTimerGetAverage(&time)); 22 return 0; 23 }