diff options
Diffstat (limited to 'src/calculer.c')
-rw-r--r-- | src/calculer.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/calculer.c b/src/calculer.c index 589724f..8c1b629 100644 --- a/src/calculer.c +++ b/src/calculer.c @@ -31,6 +31,8 @@ static int lower = 0; static int upper = 100; +static int ms; + static FILE *logfile; static char logbuf[64]; #define LOGBUF_OFFSET 11 @@ -67,10 +69,10 @@ measure_after(void *data, int correct) struct timespec tp; clock_gettime(CLOCK_REALTIME, &tp); int t1 = tp_ms(&tp); - int dt = t1 - t0; + ms = t1 - t0; size_t bytes_written = LOGBUF_OFFSET + sprintf(logbuf + LOGBUF_OFFSET, - "%d\t%d\n", dt, correct); + "%d\t%d\n", ms, correct); return bytes_written != fwrite(logbuf, 1, bytes_written, logfile); } @@ -214,7 +216,7 @@ main(int argc, char *argv[]) } #endif measure_after(measure_data, input == res); - disp->display_res(input == res, 0); + disp->display_res(input == res, ms); } fclose(logfile); |