From: Martin Mares Date: Sat, 11 Feb 2012 19:28:35 +0000 (+0100) Subject: Timer: get_timer() adds a random offset to catch misuse of timestamp_t X-Git-Tag: v5.0~47 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=512e92d5e1834cf76026cdfdec76d6f629d830c2;p=libucw.git Timer: get_timer() adds a random offset to catch misuse of timestamp_t --- diff --git a/ucw/timer.c b/ucw/timer.c index 41f51f94..31688dbe 100644 --- a/ucw/timer.c +++ b/ucw/timer.c @@ -18,7 +18,11 @@ get_timestamp(void) { struct timeval tv; gettimeofday(&tv, NULL); - return (timestamp_t)tv.tv_sec * 1000 + tv.tv_usec / 1000; + return (timestamp_t)tv.tv_sec * 1000 + tv.tv_usec / 1000 +#ifdef CONFIG_UCW_DEBUG + + 3141592653 // So that we catch all attempts to corelate timestamp_t with wall clock +#endif + ; } void