| 94 | } |
| 95 | |
| 96 | void benchmark::BenchRunner::RunAll(Printer& printer, uint64_t num_evals, double scaling, const std::string& filter, bool is_list_only) |
| 97 | { |
| 98 | if (!std::ratio_less_equal<benchmark::clock::period, std::micro>::value) { |
| 99 | std::cerr << "WARNING: Clock precision is worse than microsecond - benchmarks may be less accurate!\n"; |
| 100 | } |
| 101 | #ifdef DEBUG |
| 102 | std::cerr << "WARNING: This is a debug build - may result in slower benchmarks.\n"; |
| 103 | #endif |
| 104 | |
| 105 | std::regex reFilter(filter); |
| 106 | std::smatch baseMatch; |
| 107 | |
| 108 | printer.header(); |
| 109 | |
| 110 | for (const auto& p : benchmarks()) { |
| 111 | if (!std::regex_match(p.first, baseMatch, reFilter)) { |
| 112 | continue; |
| 113 | } |
| 114 | |
| 115 | uint64_t num_iters = static_cast<uint64_t>(p.second.num_iters_for_one_second * scaling); |
| 116 | if (0 == num_iters) { |
| 117 | num_iters = 1; |
| 118 | } |
| 119 | State state(p.first, num_evals, num_iters, printer); |
| 120 | if (!is_list_only) { |
| 121 | p.second.func(state); |
| 122 | } |
| 123 | printer.result(state); |
| 124 | } |
| 125 | |
| 126 | printer.footer(); |
| 127 | } |
| 128 | |
| 129 | bool benchmark::State::UpdateTimer(const benchmark::time_point current_time) |
| 130 | { |