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)));
}