Two bug fixes in KeepRunning.
diff --git a/src/benchmark.cc b/src/benchmark.cc
index 1ad2e32..393890d 100644
--- a/src/benchmark.cc
+++ b/src/benchmark.cc
@@ -955,7 +955,8 @@
bool State::KeepRunning() {
// Fast path
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_;
return true;
@@ -996,6 +997,9 @@
}
}
+ if (ret) {
+ ++iterations_;
+ }
return ret;
}