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

Method run

extlibs/catch/include/catch/catch.hpp:7090–7121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7088
7089 template <typename Clock = default_clock>
7090 void run() {
7091 IConfigPtr cfg = getCurrentContext().getConfig();
7092
7093 auto env = Detail::measure_environment<Clock>();
7094
7095 getResultCapture().benchmarkPreparing(name);
7096 CATCH_TRY{
7097 auto plan = user_code([&] {
7098 return prepare<Clock>(*cfg, env);
7099 });
7100
7101 BenchmarkInfo info {
7102 name,
7103 plan.estimated_duration.count(),
7104 plan.iterations_per_sample,
7105 cfg->benchmarkSamples(),
7106 cfg->benchmarkResamples(),
7107 env.clock_resolution.mean.count(),
7108 env.clock_cost.mean.count()
7109 };
7110
7111 getResultCapture().benchmarkStarting(info);
7112
7113 auto samples = user_code([&] {
7114 return plan.template run<Clock>(*cfg, env);
7115 });
7116
7117 auto analysis = Detail::analyse(*cfg, env, samples.begin(), samples.end());
7118 BenchmarkStats<std::chrono::duration<double, std::nano>> stats{ info, analysis.samples, analysis.mean, analysis.standard_deviation, analysis.outliers, analysis.outlier_variance };
7119 getResultCapture().benchmarkEnded(stats);
7120
7121 } CATCH_CATCH_ALL{
7122 if (translateActiveException() != Detail::benchmarkErrorMsg) // benchmark errors have been reported, otherwise rethrow.
7123 std::rethrow_exception(std::current_exception());
7124 }

Callers

nothing calls this directly

Calls 10

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

Tested by

no test coverage detected