From 02230445e065456371cea2a18d5fee6a33b0c1d9 Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Fri, 27 May 2016 16:53:30 -0600 Subject: [PATCH] Move UnitTime helpers to reporter.h --- include/benchmark/benchmark_api.h | 24 ------------------------ include/benchmark/reporter.h | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/include/benchmark/benchmark_api.h b/include/benchmark/benchmark_api.h index 5929c662..e705d751 100644 --- a/include/benchmark/benchmark_api.h +++ b/include/benchmark/benchmark_api.h @@ -236,30 +236,6 @@ enum TimeUnit { kMillisecond }; -inline const char* GetTimeUnitString(TimeUnit unit) { - switch (unit) { - case kMillisecond: - return "ms"; - case kMicrosecond: - return "us"; - case kNanosecond: - default: - return "ns"; - } -} - -inline double GetTimeUnitMultiplier(TimeUnit unit) { - switch (unit) { - case kMillisecond: - return 1e3; - case kMicrosecond: - return 1e6; - case kNanosecond: - default: - return 1e9; - } -} - // BigO is passed to a benchmark in order to specify the asymptotic computational // complexity for the benchmark. In case oAuto is selected, complexity will be // calculated automatically to the best fit. diff --git a/include/benchmark/reporter.h b/include/benchmark/reporter.h index da53faa4..02627547 100644 --- a/include/benchmark/reporter.h +++ b/include/benchmark/reporter.h @@ -187,5 +187,29 @@ private: void PrintRunData(const Run& report); }; +inline const char* GetTimeUnitString(TimeUnit unit) { + switch (unit) { + case kMillisecond: + return "ms"; + case kMicrosecond: + return "us"; + case kNanosecond: + default: + return "ns"; + } +} + +inline double GetTimeUnitMultiplier(TimeUnit unit) { + switch (unit) { + case kMillisecond: + return 1e3; + case kMicrosecond: + return 1e6; + case kNanosecond: + default: + return 1e9; + } +} + } // end namespace benchmark #endif // BENCHMARK_REPORTER_H_