| 7314 | |
| 7315 | template <typename Clock = default_clock> |
| 7316 | void run() { |
| 7317 | IConfigPtr cfg = getCurrentContext().getConfig(); |
| 7318 | |
| 7319 | auto env = Detail::measure_environment<Clock>(); |
| 7320 | |
| 7321 | getResultCapture().benchmarkPreparing(name); |
| 7322 | CATCH_TRY{ |
| 7323 | auto plan = user_code([&] { |
| 7324 | return prepare<Clock>(*cfg, env); |
| 7325 | }); |
| 7326 | |
| 7327 | BenchmarkInfo info { |
| 7328 | name, |
| 7329 | plan.estimated_duration.count(), |
| 7330 | plan.iterations_per_sample, |
| 7331 | cfg->benchmarkSamples(), |
| 7332 | cfg->benchmarkResamples(), |
| 7333 | env.clock_resolution.mean.count(), |
| 7334 | env.clock_cost.mean.count() |
| 7335 | }; |
| 7336 | |
| 7337 | getResultCapture().benchmarkStarting(info); |
| 7338 | |
| 7339 | auto samples = user_code([&] { |
| 7340 | return plan.template run<Clock>(*cfg, env); |
| 7341 | }); |
| 7342 | |
| 7343 | auto analysis = Detail::analyse(*cfg, env, samples.begin(), samples.end()); |
| 7344 | BenchmarkStats<FloatDuration<Clock>> stats{ info, analysis.samples, analysis.mean, analysis.standard_deviation, analysis.outliers, analysis.outlier_variance }; |
| 7345 | getResultCapture().benchmarkEnded(stats); |
| 7346 | |
| 7347 | } CATCH_CATCH_ALL{ |
| 7348 | if (translateActiveException() != Detail::benchmarkErrorMsg) // benchmark errors have been reported, otherwise rethrow. |
| 7349 | std::rethrow_exception(std::current_exception()); |
| 7350 | } |
nothing calls this directly
no test coverage detected