Move UnitTime helpers to reporter.h

This commit is contained in:
Eric Fiselier 2016-05-27 16:53:30 -06:00
parent 1b263fe6d9
commit 02230445e0
2 changed files with 24 additions and 24 deletions

View File

@ -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.

View File

@ -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_