MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / run

Method run

extlibs/catch/include/catch/catch.hpp:6696–6710  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 5

repeatFunction · 0.85
benchmarkSamplesMethod · 0.80
elapsedMethod · 0.80
ChronometerClass · 0.70
reserveMethod · 0.45

Tested by

no test coverage detected