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