mirror of
https://github.com/google/benchmark.git
synced 2025-01-30 05:40:15 +08:00
actually add new test
This commit is contained in:
parent
725f1f066d
commit
c0755c4226
24
test/walltime_test.cc
Normal file
24
test/walltime_test.cc
Normal 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()
|
Loading…
Reference in New Issue
Block a user