From: Yann Collet Date: Tue, 20 Feb 2018 23:33:56 +0000 (-0800) Subject: use TIMELOOP_NANOSEC X-Git-Tag: v1.3.4~1^2~53^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3538a535bfe1532fb33bfa85bb2b70868506d682;p=thirdparty%2Fzstd.git use TIMELOOP_NANOSEC as suggested by @terrelln --- diff --git a/programs/bench.c b/programs/bench.c index e67c886b3..5997cfbca 100644 --- a/programs/bench.c +++ b/programs/bench.c @@ -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;