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

Method run

lib/catch2/catch.hpp:6918–6932  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected