Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions include/benchmark/state.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ class BENCHMARK_EXPORT BENCHMARK_INTERNAL_CACHELINE_ALIGNED State {
// State is exported, and MSVC otherwise calls the copy of this function
// inside benchmark.dll, which was built with the library's NDEBUG.
inline BENCHMARK_ALWAYS_INLINE void PauseTiming() {
assert(started_ && !finished_ && !skipped() &&
assert(in_timed_section() &&
"PauseTiming() called outside of the benchmark loop");
PauseTimingImpl();
}

// Only valid while the benchmark loop is running. Forced inline for the
// same reason as PauseTiming().
inline BENCHMARK_ALWAYS_INLINE void ResumeTiming() {
assert(started_ && !finished_ && !skipped() &&
assert(in_timed_section() &&
"ResumeTiming() called outside of the benchmark loop");
ResumeTimingImpl();
}
Expand All @@ -77,6 +77,8 @@ class BENCHMARK_EXPORT BENCHMARK_INTERNAL_CACHELINE_ALIGNED State {

bool skipped() const { return internal::NotSkipped != skipped_; }

bool in_timed_section() const { return started_ && !finished_ && !skipped(); }

bool error_occurred() const { return internal::SkippedWithError == skipped_; }

void SetIterationTime(double seconds);
Expand Down
Loading