diff options
| author | Wladimir J. van der Laan <[email protected]> | 2016-11-22 12:20:28 +0100 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2016-11-22 12:20:34 +0100 |
| commit | 55b2eddcc8fd407aa62fd280f4767e3034a7eb04 (patch) | |
| tree | c364b3a50ffbb06cff94102754da92729feada7e /src | |
| parent | Merge #9185: [Qt] fix coincontrol sort issue (diff) | |
| parent | bench: Fix subtle counting issue when rescaling iteration count (diff) | |
| download | discoin-55b2eddcc8fd407aa62fd280f4767e3034a7eb04.tar.xz discoin-55b2eddcc8fd407aa62fd280f4767e3034a7eb04.zip | |
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)
Diffstat (limited to 'src')
| -rw-r--r-- | src/bench/bench.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/bench/bench.cpp b/src/bench/bench.cpp index 227546a7a..8942da8c7 100644 --- a/src/bench/bench.cpp +++ b/src/bench/bench.cpp @@ -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; |