X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=time.c;h=90c6735644540f1431afcc1b376da0662823e80c;hp=6bb9a50f5b32f7441943817dc22f868d0f0131cd;hb=6ba4caacaeb4ac2d8e5fc15699bf89f496d59901;hpb=f167629b3191c57a6b691cd2a6af04a45a74ccb0 diff --git a/time.c b/time.c index 6bb9a50f..90c67356 100644 --- a/time.c +++ b/time.c @@ -198,22 +198,14 @@ void compute_chunk_time(long unsigned chunk_num, struct timeval *clock_get_realtime(struct timeval *tv) { static struct timeval user_friendly; + struct timespec t; + int ret; if (!tv) tv = &user_friendly; -#ifdef HAVE_CLOCK_GETTIME - { - struct timespec t; - int ret; - - ret = clock_gettime(CLOCK_REALTIME, &t); - assert(ret == 0); - tv->tv_sec = t.tv_sec; - tv->tv_usec = t.tv_nsec / 1000; - } -#else - #include - gettimeofday(tv, NULL); -#endif /* HAVE_CLOCK_GETTIME */ + ret = clock_gettime(CLOCK_REALTIME, &t); + assert(ret == 0); + tv->tv_sec = t.tv_sec; + tv->tv_usec = t.tv_nsec / 1000; return tv; }