From cac1efe7a8755bf34049f17cb859e32d13605ac1 Mon Sep 17 00:00:00 2001 From: Laurent Mazet Date: Mon, 2 Sep 2024 23:17:04 +0200 Subject: [PATCH] estimate tic --- time.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/time.c b/time.c index a342181..8ecebf4 100644 --- a/time.c +++ b/time.c @@ -1,8 +1,10 @@ +#include #include #include #include #include +#include "debug.h" #include "time.h" int newseed (int seed) @@ -27,6 +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)); return ((t->tv_sec < c->tv_sec) || ((t->tv_sec == c->tv_sec) && ( t->tv_usec < c->tv_usec))); } -- 2.30.2