use TIMELOOP_NANOSEC
as suggested by @terrelln
This commit is contained in:
+2
-2
@@ -352,7 +352,7 @@ static int BMK_benchMem(const void* srcBuffer, size_t srcSize,
|
|||||||
if (loopDuration > 0) {
|
if (loopDuration > 0) {
|
||||||
if (loopDuration < fastestC * nbCompressionLoops)
|
if (loopDuration < fastestC * nbCompressionLoops)
|
||||||
fastestC = loopDuration / nbCompressionLoops;
|
fastestC = loopDuration / nbCompressionLoops;
|
||||||
nbCompressionLoops = (1000000000 / fastestC) + 1;
|
nbCompressionLoops = (TIMELOOP_NANOSEC / fastestC) + 1;
|
||||||
} else {
|
} else {
|
||||||
assert(nbCompressionLoops < 40000000); /* avoid overflow */
|
assert(nbCompressionLoops < 40000000); /* avoid overflow */
|
||||||
nbCompressionLoops *= 100;
|
nbCompressionLoops *= 100;
|
||||||
@@ -411,7 +411,7 @@ static int BMK_benchMem(const void* srcBuffer, size_t srcSize,
|
|||||||
if (loopDuration > 0) {
|
if (loopDuration > 0) {
|
||||||
if (loopDuration < fastestD * nbDecodeLoops)
|
if (loopDuration < fastestD * nbDecodeLoops)
|
||||||
fastestD = loopDuration / nbDecodeLoops;
|
fastestD = loopDuration / nbDecodeLoops;
|
||||||
nbDecodeLoops = (1000000000/*1sec*/ / fastestD) + 1;
|
nbDecodeLoops = (TIMELOOP_NANOSEC / fastestD) + 1;
|
||||||
} else {
|
} else {
|
||||||
assert(nbDecodeLoops < 40000000); /* avoid overflow */
|
assert(nbDecodeLoops < 40000000); /* avoid overflow */
|
||||||
nbDecodeLoops *= 100;
|
nbDecodeLoops *= 100;
|
||||||
|
|||||||
Reference in New Issue
Block a user