MCPcopy Create free account
hub / github.com/apache/trafficserver / prepare

Method prepare

lib/catch2/catch.hpp:7307–7313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7305
7306 template <typename Clock>
7307 ExecutionPlan<FloatDuration<Clock>> prepare(const IConfig &cfg, Environment<FloatDuration<Clock>> env) const {
7308 auto min_time = env.clock_resolution.mean * Detail::minimum_ticks;
7309 auto run_time = std::max(min_time, std::chrono::duration_cast<decltype(min_time)>(cfg.benchmarkWarmupTime()));
7310 auto&& test = Detail::run_for_at_least<Clock>(std::chrono::duration_cast<ClockDuration<Clock>>(run_time), 1, fun);
7311 int new_iters = static_cast<int>(std::ceil(min_time * test.iterations / test.elapsed));
7312 return { new_iters, test.elapsed / test.iterations * new_iters * cfg.benchmarkSamples(), fun, std::chrono::duration_cast<FloatDuration<Clock>>(cfg.benchmarkWarmupTime()), Detail::warmup_iterations };
7313 }
7314
7315 template <typename Clock = default_clock>
7316 void run() {

Callers

nothing calls this directly

Calls 2

benchmarkWarmupTimeMethod · 0.80
benchmarkSamplesMethod · 0.80

Tested by

no test coverage detected