From: Loup Vaillant Date: Fri, 22 Feb 2019 20:14:06 +0000 (+0100) Subject: Added comment on speed tests X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=5b463000c682fdf02aa3b4f6c761785a79ada88d;p=Monocypher.git 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. --- 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)