Browse Source

Merge #9200: bench: Fix subtle counting issue when rescaling iteration count

e0a9cb2 bench: Fix subtle counting issue when rescaling iteration count (Wladimir J. van der Laan)
0.14
Wladimir J. van der Laan 8 years ago
parent
commit
55b2eddcc8
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 7
      src/bench/bench.cpp

7
src/bench/bench.cpp

@ -64,8 +64,11 @@ bool State::KeepRunning() @@ -64,8 +64,11 @@ bool State::KeepRunning()
return true;
}
if (elapsed*16 < maxElapsed) {
countMask = ((countMask<<1)|1) & ((1LL<<60)-1);
countMaskInv = 1./(countMask+1);
uint64_t newCountMask = ((countMask<<1)|1) & ((1LL<<60)-1);
if ((count & newCountMask)==0) {
countMask = newCountMask;
countMaskInv = 1./(countMask+1);
}
}
}
lastTime = now;

Loading…
Cancel
Save