Require a steady clock for bench with at least micro precision

This commit is contained in:
Matt Corallo
2017-11-09 11:48:13 -05:00
parent 9e9e31aa10
commit 620bae34cf
2 changed files with 5 additions and 4 deletions

View File

@@ -23,6 +23,9 @@ void
benchmark::BenchRunner::RunAll(benchmark::duration elapsedTimeForOne)
{
perf_init();
if (std::ratio_less_equal<benchmark::clock::period, std::micro>::value) {
std::cerr << "WARNING: Clock precision is worse than microsecond - benchmarks may be less accurate!\n";
}
std::cout << "#Benchmark" << "," << "count" << "," << "min(ns)" << "," << "max(ns)" << "," << "average(ns)" << ","
<< "min_cycles" << "," << "max_cycles" << "," << "average_cycles" << "\n";