Commit 02230445 by Eric Fiselier

Move UnitTime helpers to reporter.h

parent 1b263fe6
...@@ -236,30 +236,6 @@ enum TimeUnit { ...@@ -236,30 +236,6 @@ enum TimeUnit {
kMillisecond 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 // 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 // complexity for the benchmark. In case oAuto is selected, complexity will be
// calculated automatically to the best fit. // calculated automatically to the best fit.
......
...@@ -187,5 +187,29 @@ private: ...@@ -187,5 +187,29 @@ private:
void PrintRunData(const Run& report); 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 } // end namespace benchmark
#endif // BENCHMARK_REPORTER_H_ #endif // BENCHMARK_REPORTER_H_
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