]> git.codecow.com Git - Monocypher.git/commitdiff
Added comment on speed tests
authorLoup Vaillant <loup@loup-vaillant.fr>
Fri, 22 Feb 2019 20:14:06 +0000 (21:14 +0100)
committerLoup Vaillant <loup@loup-vaillant.fr>
Fri, 22 Feb 2019 20:14:11 +0000 (21:14 +0100)
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

index c83b001594328dafc7085020e733cd520d0a077c..b9d0455a3351fe61193fcec594f7b57f1f8c8059 100644 (file)
@@ -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)