summaryrefslogtreecommitdiff
path: root/gettime.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2012-12-10 08:07:14 +0100
committerJens Axboe <axboe@kernel.dk>2012-12-10 08:07:14 +0100
commit486332e567826eb284bfd9064440867f31fccd7f (patch)
treec7571ff8df704004f993cfb3a1329f161458805f /gettime.c
parentfa80feae51331fb170e784459fa1359d7ec3a963 (diff)
downloadfio-486332e567826eb284bfd9064440867f31fccd7f.tar.gz
fio-486332e567826eb284bfd9064440867f31fccd7f.tar.bz2
Increase CPU clock calibration accuracy
Lets throw some more loops at it, it reduces the noise. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'gettime.c')
-rw-r--r--gettime.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gettime.c b/gettime.c
index 89a3a016..549c35e9 100644
--- a/gettime.c
+++ b/gettime.c
@@ -201,13 +201,13 @@ static unsigned long get_cycles_per_usec(void)
gettimeofday(&e, NULL);
elapsed = utime_since(&s, &e);
- if (elapsed >= 10) {
+ if (elapsed >= 1280) {
c_e = get_cpu_clock();
break;
}
} while (1);
- return c_e - c_s;
+ return (c_e - c_s) >> 7;
}
#define NR_TIME_ITERS 50