X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=metrics.c;h=8d2d6444beae601b9de93eea5d503a91729321c0;hb=c063b28a99d7ee825bcc84e00737469049592169;hp=f4c0a2150f05b2092031a17907da231631b09bd4;hpb=c0c549440d852153d1777eca3fa962c1b70483b3;p=fips diff --git a/metrics.c b/metrics.c index f4c0a21..8d2d644 100644 --- a/metrics.c +++ b/metrics.c @@ -141,18 +141,7 @@ metrics_end_frame (void) frames++; - - if (frames % 60 == 0) { - double fps; - gettimeofday (&tv_now, NULL); - - fps = (double) frames / (tv_now.tv_sec - tv_start.tv_sec + - (tv_now.tv_usec - tv_start.tv_usec) / 1.0e6); - - printf("FPS: %.3f\n", fps); - - print_program_metrics (); - } + gettimeofday (&tv_now, NULL); /* Consume all counters that are ready. */ counter_t *counter = current_context.counter_head; @@ -179,4 +168,15 @@ metrics_end_frame (void) free (counter); counter = current_context.counter_head; } + + if (frames % 60 == 0) { + double fps; + + fps = (double) frames / (tv_now.tv_sec - tv_start.tv_sec + + (tv_now.tv_usec - tv_start.tv_usec) / 1.0e6); + + printf("FPS: %.3f\n", fps); + + print_program_metrics (); + } }