Commit 21207a4d by Eric Fiselier

improve walltime test

parent c0755c42
......@@ -5,16 +5,28 @@
#include "../src/walltime.h"
void BM_CPUTimeNow(benchmark::State& state) {
using benchmark::walltime::CPUWalltimeNow;
while (state.KeepRunning()) {
benchmark::WallTime volatile now = benchmark::walltime::CPUWalltimeNow();
benchmark::WallTime volatile now;
now = CPUWalltimeNow();
now = CPUWalltimeNow();
now = CPUWalltimeNow();
now = CPUWalltimeNow();
now = CPUWalltimeNow();
((void)now);
}
}
BENCHMARK(BM_CPUTimeNow);
void BM_ChronoTimeNow(benchmark::State& state) {
using benchmark::walltime::ChronoWalltimeNow;
while (state.KeepRunning()) {
benchmark::WallTime volatile now = benchmark::walltime::ChronoWalltimeNow();
benchmark::WallTime volatile now;
now = ChronoWalltimeNow();
now = ChronoWalltimeNow();
now = ChronoWalltimeNow();
now = ChronoWalltimeNow();
now = ChronoWalltimeNow();
((void)now);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment