| 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 | } |
nothing calls this directly
no test coverage detected