| 6916 | |
| 6917 | template <typename Clock> |
| 6918 | std::vector<FloatDuration<Clock>> run(const IConfig &cfg, Environment<FloatDuration<Clock>> env) const { |
| 6919 | // warmup a bit |
| 6920 | Detail::run_for_at_least<Clock>(std::chrono::duration_cast<ClockDuration<Clock>>(warmup_time), warmup_iterations, Detail::repeat(now<Clock>{})); |
| 6921 | |
| 6922 | std::vector<FloatDuration<Clock>> times; |
| 6923 | times.reserve(cfg.benchmarkSamples()); |
| 6924 | std::generate_n(std::back_inserter(times), cfg.benchmarkSamples(), [this, env] { |
| 6925 | Detail::ChronometerModel<Clock> model; |
| 6926 | this->benchmark(Chronometer(model, iterations_per_sample)); |
| 6927 | auto sample_time = model.elapsed() - env.clock_cost.mean; |
| 6928 | if (sample_time < FloatDuration<Clock>::zero()) sample_time = FloatDuration<Clock>::zero(); |
| 6929 | return sample_time / iterations_per_sample; |
| 6930 | }); |
| 6931 | return times; |
| 6932 | } |
| 6933 | }; |
| 6934 | } // namespace Benchmark |
| 6935 | } // namespace Catch |
nothing calls this directly
no test coverage detected