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

Method run

test/expected/catch.hpp:7248–7279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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