Skip to content

Commit 41b9925

Browse files
committed
fix: instrumentation
1 parent 6c8a1aa commit 41b9925

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

google_benchmark/include/benchmark/benchmark.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,9 +1065,16 @@ struct State::StateIterator {
10651065
bool operator!=(StateIterator const&) const {
10661066
if (BENCHMARK_BUILTIN_EXPECT(cached_ != 0, true)) return true;
10671067

1068+
10681069
#if defined(CODSPEED_INSTRUMENTATION) || defined(CODSPEED_WALLTIME)
10691070
measurement_stop();
10701071
#endif
1072+
#ifdef CODSPEED_INSTRUMENTATION
1073+
if (parent_->codspeed_ != NULL) {
1074+
parent_->codspeed_->end_benchmark();
1075+
}
1076+
#endif
1077+
10711078
parent_->FinishKeepRunning();
10721079
return false;
10731080
}
@@ -1083,6 +1090,11 @@ inline BENCHMARK_ALWAYS_INLINE State::StateIterator State::begin() {
10831090
inline BENCHMARK_ALWAYS_INLINE State::StateIterator State::end() {
10841091
StartKeepRunning();
10851092

1093+
#ifdef CODSPEED_INSTRUMENTATION
1094+
if (parent_->codspeed_ != NULL) {
1095+
parent_->codspeed_->start_benchmark();
1096+
}
1097+
#endif
10861098
#if defined(CODSPEED_INSTRUMENTATION) || defined(CODSPEED_WALLTIME)
10871099
measurement_start();
10881100
#endif

0 commit comments

Comments
 (0)