From 9ca18081624454388e6c8fc999ef015b12330d4f Mon Sep 17 00:00:00 2001 From: Laurent Mazet Date: Mon, 2 Sep 2024 23:51:11 +0200 Subject: [PATCH] estimate tic (2) --- time.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/time.c b/time.c index 8ecebf4..7760d33 100644 --- a/time.c +++ b/time.c @@ -29,7 +29,7 @@ int isovertime (timeval_t *t) struct timeval _c; struct timeval *c = &_c; gettimeofday (c, NULL); - VERBOSE (INFO, FILE *log = fopen ("snake.log", "a"); long msec = (c->tv_sec == t->tv_sec) ? ((long)c->tv_usec - (long)t->tv_usec) : ((long)t->tv_usec - (long)c->tv_usec); fprintf (log, "diff: %ld\n", msec / 1000); fclose (log)); + VERBOSE (INFO, FILE *log = fopen ("snake.log", "a"); long msec = (c->tv_usec - t->tv_usec) / 1000; if (c->tv_sec != t->tv_sec) msec += 1000; fprintf (log, "diff: %ld\n", msec); fclose (log)); return ((t->tv_sec < c->tv_sec) || ((t->tv_sec == c->tv_sec) && ( t->tv_usec < c->tv_usec))); } -- 2.30.2