Commit 1b9e55c2 by Eric Fiselier

Remove walltime implementation tests and expose less internals

parent d3e0671a
...@@ -163,9 +163,6 @@ WallTimeImp::WallTimeImp() ...@@ -163,9 +163,6 @@ WallTimeImp::WallTimeImp()
last_adjust_time_ = static_cast<uint32_t>(uint64_t(base_cycletime_) >> 32); last_adjust_time_ = static_cast<uint32_t>(uint64_t(base_cycletime_) >> 32);
} }
} // end anonymous namespace
WallTime CPUWalltimeNow() { WallTime CPUWalltimeNow() {
static WallTimeImp& imp = WallTimeImp::GetWallTimeImp(); static WallTimeImp& imp = WallTimeImp::GetWallTimeImp();
return imp.Now(); return imp.Now();
...@@ -191,6 +188,9 @@ bool UseCpuCycleClock() { ...@@ -191,6 +188,9 @@ bool UseCpuCycleClock() {
return useWallTime; return useWallTime;
} }
} // end anonymous namespace
// WallTimeImp doesn't work when CPU Scaling is enabled. If CPU Scaling is // WallTimeImp doesn't work when CPU Scaling is enabled. If CPU Scaling is
// enabled at the start of the program then std::chrono::system_clock is used // enabled at the start of the program then std::chrono::system_clock is used
// instead. // instead.
......
...@@ -7,8 +7,6 @@ namespace benchmark { ...@@ -7,8 +7,6 @@ namespace benchmark {
typedef double WallTime; typedef double WallTime;
namespace walltime { namespace walltime {
WallTime CPUWalltimeNow();
WallTime ChronoWalltimeNow();
WallTime Now(); WallTime Now();
} // end namespace walltime } // end namespace walltime
......
...@@ -32,5 +32,3 @@ compile_benchmark_test(cxx03_test) ...@@ -32,5 +32,3 @@ compile_benchmark_test(cxx03_test)
set_target_properties(cxx03_test set_target_properties(cxx03_test
PROPERTIES COMPILE_FLAGS "${CXX03_FLAGS}") PROPERTIES COMPILE_FLAGS "${CXX03_FLAGS}")
add_test(cxx03 cxx03_test) add_test(cxx03 cxx03_test)
compile_benchmark_test(walltime_test)
#include <cstddef>
#include "benchmark/benchmark_api.h"
#include "../src/walltime.h"
void BM_CPUTimeNow(benchmark::State& state) {
using benchmark::walltime::CPUWalltimeNow;
while (state.KeepRunning()) {
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;
now = ChronoWalltimeNow();
now = ChronoWalltimeNow();
now = ChronoWalltimeNow();
now = ChronoWalltimeNow();
now = ChronoWalltimeNow();
((void)now);
}
}
BENCHMARK(BM_ChronoTimeNow);
BENCHMARK_MAIN()
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