X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=time.c;h=bb47b31b7b262ca8a988377d899e166abdd5d029;hp=6042c487f57db31c3741e02a4e0ed600cba87a43;hb=0c7c4d80673854527ce3c3786dd581169565b5e6;hpb=cb4f8bc9718816110bef77ed1ba124d723c253b5 diff --git a/time.c b/time.c index 6042c487..bb47b31b 100644 --- a/time.c +++ b/time.c @@ -1,8 +1,4 @@ -/* - * Copyright (C) 2005-2014 Andre Noll - * - * Licensed under the GPL v2. For licencing details see COPYING. - */ +/* Copyright (C) 2005 Andre Noll , see file COPYING. */ #include "para.h" /** \file time.c Helper functions for dealing with time values. */ @@ -198,22 +194,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; }