actually add new test

This commit is contained in:
Eric Fiselier 2015-03-26 14:57:03 -04:00
parent 725f1f066d
commit c0755c4226

24
test/walltime_test.cc Normal file
View File

@ -0,0 +1,24 @@
#include <cstddef>
#include "benchmark/benchmark_api.h"
#include "../src/walltime.h"
void BM_CPUTimeNow(benchmark::State& state) {
while (state.KeepRunning()) {
benchmark::WallTime volatile now = benchmark::walltime::CPUWalltimeNow();
((void)now);
}
}
BENCHMARK(BM_CPUTimeNow);
void BM_ChronoTimeNow(benchmark::State& state) {
while (state.KeepRunning()) {
benchmark::WallTime volatile now = benchmark::walltime::ChronoWalltimeNow();
((void)now);
}
}
BENCHMARK(BM_ChronoTimeNow);
BENCHMARK_MAIN()