mirror of
https://github.com/google/benchmark.git
synced 2025-03-28 21:10:58 +08:00
Merge pull request #27 from pleroy/TwoBugs
Two bug fixes in KeepRunning
This commit is contained in:
commit
7c428e91b7
@ -30,6 +30,7 @@ Dominic Hamon <dma@stripysock.com>
|
|||||||
Eugene Zhuk <eugene.zhuk@gmail.com>
|
Eugene Zhuk <eugene.zhuk@gmail.com>
|
||||||
Felix Homann <linuxaudio@showlabor.de>
|
Felix Homann <linuxaudio@showlabor.de>
|
||||||
Oleksandr Sochka <sasha.sochka@gmail.com>
|
Oleksandr Sochka <sasha.sochka@gmail.com>
|
||||||
|
Pascal Leroy <phl@google.com>
|
||||||
Pierre Phaneuf <pphaneuf@google.com>
|
Pierre Phaneuf <pphaneuf@google.com>
|
||||||
Shuo Chen <chenshuo@chenshuo.com>
|
Shuo Chen <chenshuo@chenshuo.com>
|
||||||
Yusuke Suzuki <utatane.tea@gmail.com>
|
Yusuke Suzuki <utatane.tea@gmail.com>
|
||||||
|
@ -955,7 +955,8 @@ State::State(FastClock* clock, SharedState* s, int t)
|
|||||||
bool State::KeepRunning() {
|
bool State::KeepRunning() {
|
||||||
// Fast path
|
// Fast path
|
||||||
if ((FLAGS_benchmark_iterations == 0 &&
|
if ((FLAGS_benchmark_iterations == 0 &&
|
||||||
!clock_->HasReached(stop_time_micros_ + pause_time_)) ||
|
!clock_->HasReached(stop_time_micros_ +
|
||||||
|
kNumMicrosPerSecond * pause_time_)) ||
|
||||||
iterations_ < FLAGS_benchmark_iterations) {
|
iterations_ < FLAGS_benchmark_iterations) {
|
||||||
++iterations_;
|
++iterations_;
|
||||||
return true;
|
return true;
|
||||||
@ -996,6 +997,9 @@ bool State::KeepRunning() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ret) {
|
||||||
|
++iterations_;
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user