I am running some performance tests using google benchmark API. I use state.PauseTiming() and state.ResumeTiming() to avoid unnecessary code segments runs through perf path. I have attached the sample code below
while (state.KeepRunning()) {
state.PauseTiming();
state.ResumeTiming();
state.PauseTiming();
state.ResumeTiming();
}
Those functions itself took 323ns for 2 pauses and resumes.
hiRun on (16 X 3196.36 MHz CPU s)
2019-06-19 11:21:06
---------------------------------------------------------------
Benchmark Time CPU Iterations
---------------------------------------------------------------
Benchmark_Test1 323 ns 324 ns 2158319
It this a bug in google benchmark API or are there any workarounds for this?