MCPcopy Create free account
hub / github.com/Profactor/cv-plot / run

Method run

CvPlot/ext/catch2/inc/catch.hpp:7246–7277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7244
7245 template <typename Clock = default_clock>
7246 void run() {
7247 IConfigPtr cfg = getCurrentContext().getConfig();
7248
7249 auto env = Detail::measure_environment<Clock>();
7250
7251 getResultCapture().benchmarkPreparing(name);
7252 CATCH_TRY{
7253 auto plan = user_code([&] {
7254 return prepare<Clock>(*cfg, env);
7255 });
7256
7257 BenchmarkInfo info {
7258 name,
7259 plan.estimated_duration.count(),
7260 plan.iterations_per_sample,
7261 cfg->benchmarkSamples(),
7262 cfg->benchmarkResamples(),
7263 env.clock_resolution.mean.count(),
7264 env.clock_cost.mean.count()
7265 };
7266
7267 getResultCapture().benchmarkStarting(info);
7268
7269 auto samples = user_code([&] {
7270 return plan.template run<Clock>(*cfg, env);
7271 });
7272
7273 auto analysis = Detail::analyse(*cfg, env, samples.begin(), samples.end());
7274 BenchmarkStats<FloatDuration<Clock>> stats{ info, analysis.samples, analysis.mean, analysis.standard_deviation, analysis.outliers, analysis.outlier_variance };
7275 getResultCapture().benchmarkEnded(stats);
7276
7277 } CATCH_CATCH_ALL{
7278 if (translateActiveException() != Detail::benchmarkErrorMsg) // benchmark errors have been reported, otherwise rethrow.
7279 std::rethrow_exception(std::current_exception());
7280 }

Callers

nothing calls this directly

Calls 10

user_codeFunction · 0.85
analyseFunction · 0.85
countMethod · 0.80
benchmarkSamplesMethod · 0.80
benchmarkResamplesMethod · 0.80
benchmarkPreparingMethod · 0.45
benchmarkStartingMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
benchmarkEndedMethod · 0.45

Tested by

no test coverage detected