diff options
| author | Matt Corallo <[email protected]> | 2017-11-09 11:48:13 -0500 |
|---|---|---|
| committer | Matt Corallo <[email protected]> | 2017-11-09 14:36:11 -0500 |
| commit | 620bae34cfe10e20daa0dcec7e4b9ffee8dfd397 (patch) | |
| tree | 6963a58641a5777c3f9734a5f7440b268e3ee049 /src/bench/bench.cpp | |
| parent | Fix qt build broken by 5a5e4e9 (diff) | |
| download | discoin-620bae34cfe10e20daa0dcec7e4b9ffee8dfd397.tar.xz discoin-620bae34cfe10e20daa0dcec7e4b9ffee8dfd397.zip | |
Require a steady clock for bench with at least micro precision
Diffstat (limited to 'src/bench/bench.cpp')
| -rw-r--r-- | src/bench/bench.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/bench/bench.cpp b/src/bench/bench.cpp index dd4ba5ab0..4c5a03677 100644 --- a/src/bench/bench.cpp +++ b/src/bench/bench.cpp @@ -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"; |