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

Method prepare

extlibs/catch/include/catch/catch.hpp:7081–7087  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7079
7080 template <typename Clock>
7081 ExecutionPlan<FloatDuration<Clock>> prepare(const IConfig &cfg, Environment<FloatDuration<Clock>> env) const {
7082 auto min_time = env.clock_resolution.mean * Detail::minimum_ticks;
7083 auto run_time = std::max(min_time, std::chrono::duration_cast<decltype(min_time)>(Detail::warmup_time));
7084 auto&& test = Detail::run_for_at_least<Clock>(std::chrono::duration_cast<ClockDuration<Clock>>(run_time), 1, fun);
7085 int new_iters = static_cast<int>(std::ceil(min_time * test.iterations / test.elapsed));
7086 return { new_iters, test.elapsed / test.iterations * new_iters * cfg.benchmarkSamples(), fun, std::chrono::duration_cast<FloatDuration<Clock>>(Detail::warmup_time), Detail::warmup_iterations };
7087 }
7088
7089 template <typename Clock = default_clock>
7090 void run() {

Callers

nothing calls this directly

Calls 1

benchmarkSamplesMethod · 0.80

Tested by

no test coverage detected