1#ifndef BENCHMARK_TIMERS_H
2#define BENCHMARK_TIMERS_H
10double ProcessCPUUsage();
13double ChildrenCPUUsage();
16double ThreadCPUUsage();
18#if defined(HAVE_STEADY_CLOCK)
19template <
bool HighResIsSteady = std::chrono::high_resolution_clock::is_steady>
20struct ChooseSteadyClock {
21 typedef std::chrono::high_resolution_clock type;
25struct ChooseSteadyClock<false> {
26 typedef std::chrono::steady_clock type;
31#if defined(HAVE_STEADY_CLOCK)
32 typedef ChooseSteadyClock<>::type type;
34 typedef std::chrono::high_resolution_clock type;
38inline double ChronoClockNow() {
39 typedef ChooseClockType::type ClockType;
40 using FpSeconds = std::chrono::duration<double, std::chrono::seconds::period>;
41 return FpSeconds(ClockType::now().time_since_epoch()).count();
44std::string LocalDateTimeString();