]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
use TIMELOOP_NANOSEC
authorYann Collet <cyan@fb.com>
Tue, 20 Feb 2018 23:33:56 +0000 (15:33 -0800)
committerYann Collet <cyan@fb.com>
Tue, 20 Feb 2018 23:33:56 +0000 (15:33 -0800)
as suggested by @terrelln

programs/bench.c

index e67c886b35207a06ee93fb24ff0c850c65c26c84..5997cfbca0e4cfd25a06043a2a7c512bbe30a122 100644 (file)
@@ -352,7 +352,7 @@ static int BMK_benchMem(const void* srcBuffer, size_t srcSize,
                         if (loopDuration > 0) {
                             if (loopDuration < fastestC * nbCompressionLoops)
                                 fastestC = loopDuration / nbCompressionLoops;
-                            nbCompressionLoops = (1000000000 / fastestC) + 1;
+                            nbCompressionLoops = (TIMELOOP_NANOSEC / fastestC) + 1;
                         } else {
                             assert(nbCompressionLoops < 40000000);  /* avoid overflow */
                             nbCompressionLoops *= 100;
@@ -411,7 +411,7 @@ static int BMK_benchMem(const void* srcBuffer, size_t srcSize,
                     if (loopDuration > 0) {
                         if (loopDuration < fastestD * nbDecodeLoops)
                             fastestD = loopDuration / nbDecodeLoops;
-                        nbDecodeLoops = (1000000000/*1sec*/ / fastestD) + 1;
+                        nbDecodeLoops = (TIMELOOP_NANOSEC / fastestD) + 1;
                     } else {
                         assert(nbDecodeLoops < 40000000);  /* avoid overflow */
                         nbDecodeLoops *= 100;