| 6694 | |
| 6695 | template <typename Clock> |
| 6696 | std::vector<FloatDuration<Clock>> run(const IConfig &cfg, Environment<FloatDuration<Clock>> env) const { |
| 6697 | // warmup a bit |
| 6698 | Detail::run_for_at_least<Clock>(std::chrono::duration_cast<ClockDuration<Clock>>(warmup_time), warmup_iterations, Detail::repeat(now<Clock>{})); |
| 6699 | |
| 6700 | std::vector<FloatDuration<Clock>> times; |
| 6701 | times.reserve(cfg.benchmarkSamples()); |
| 6702 | std::generate_n(std::back_inserter(times), cfg.benchmarkSamples(), [this, env] { |
| 6703 | Detail::ChronometerModel<Clock> model; |
| 6704 | this->benchmark(Chronometer(model, iterations_per_sample)); |
| 6705 | auto sample_time = model.elapsed() - env.clock_cost.mean; |
| 6706 | if (sample_time < FloatDuration<Clock>::zero()) sample_time = FloatDuration<Clock>::zero(); |
| 6707 | return sample_time / iterations_per_sample; |
| 6708 | }); |
| 6709 | return times; |
| 6710 | } |
| 6711 | }; |
| 6712 | } // namespace Benchmark |
| 6713 | } // namespace Catch |
nothing calls this directly
no test coverage detected