From 5b463000c682fdf02aa3b4f6c761785a79ada88d Mon Sep 17 00:00:00 2001 From: Loup Vaillant Date: Fri, 22 Feb 2019 21:14:06 +0100 Subject: [PATCH] Added comment on speed tests The way I measure timings is not perfectly portable. Users who get weird results are encouraged to modify this bit of code to have proper measurements. --- tests/speed.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/speed.h b/tests/speed.h index c83b001..b9d0455 100644 --- a/tests/speed.h +++ b/tests/speed.h @@ -36,6 +36,9 @@ static void print(const char *name, u64 duration, const char *unit) } } +// Note: not all systems will work well with CLOCK_PROCESS_CPUTIME_ID. +// If you get weird timings on your system, you may want to replace it +// with another clock id. Perhaps even replace clock_gettime(). #define TIMESTAMP(t) \ timespec t; \ clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &t) -- 2.47.3