bench: use CLOCK_MONOTONIC
authornsz <nsz@port70.net>
Thu, 28 Jul 2011 23:21:02 +0000 (01:21 +0200)
committernsz <nsz@port70.net>
Thu, 28 Jul 2011 23:21:02 +0000 (01:21 +0200)
common/bench.c

index 2e1ace5..4c4d118 100644 (file)
@@ -29,15 +29,7 @@ static unsigned long long nsclock() {
        struct timespec ts;
        int r;
 
-#ifdef _POSIX_CPUTIME
-       r = clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts);
-#else
-#ifdef _POSIX_MONOTONIC_CLOCK
        r = clock_gettime(CLOCK_MONOTONIC, &ts);
-#else
-       r = clock_gettime(CLOCK_REALTIME, &ts);
-#endif
-#endif
        if (r < 0) {
                fprintf(stderr, "bench: clock_gettime failed: %s\n", strerror(errno));
                return 0;