Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMartin Hořeňovský2023-12-21 18:40:00 +0100
committerMartin Hořeňovský2023-12-21 18:40:00 +0100
commit64ade68ca2b20a1d4f850a92882ba7e9a31543d9 (patch)
treeb3cdefd70555c12bc4b905aa7ade766a4e073800
parent680064d39132c452176c64bd15203d2d7e58d277 (diff)
downloadcatch3-64ade68ca2b20a1d4f850a92882ba7e9a31543d9.tar.gz
Remove superfluous duration_casts from benchmarking
-rw-r--r--src/catch2/benchmark/detail/catch_estimate_clock.hpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/catch2/benchmark/detail/catch_estimate_clock.hpp b/src/catch2/benchmark/detail/catch_estimate_clock.hpp
index 918484a9..8e355279 100644
--- a/src/catch2/benchmark/detail/catch_estimate_clock.hpp
+++ b/src/catch2/benchmark/detail/catch_estimate_clock.hpp
@@ -55,12 +55,12 @@ namespace Catch {
template <typename Clock>
int warmup() {
- return run_for_at_least<Clock>(std::chrono::duration_cast<IDuration>(warmup_time), warmup_seed, &resolution<Clock>)
+ return run_for_at_least<Clock>(warmup_time, warmup_seed, &resolution<Clock>)
.iterations;
}
template <typename Clock>
EnvironmentEstimate estimate_clock_resolution(int iterations) {
- auto r = run_for_at_least<Clock>(std::chrono::duration_cast<IDuration>(clock_resolution_estimation_time), iterations, &resolution<Clock>)
+ auto r = run_for_at_least<Clock>(clock_resolution_estimation_time, iterations, &resolution<Clock>)
.result;
return {
FDuration(mean(r.data(), r.data() + r.size())),
@@ -82,7 +82,7 @@ namespace Catch {
};
time_clock(1);
int iters = clock_cost_estimation_iterations;
- auto&& r = run_for_at_least<Clock>(std::chrono::duration_cast<IDuration>(clock_cost_estimation_time), iters, time_clock);
+ auto&& r = run_for_at_least<Clock>(clock_cost_estimation_time, iters, time_clock);
std::vector<double> times;
int nsamples = static_cast<int>(std::ceil(time_limit / r.elapsed));
times.reserve(static_cast<size_t>(nsamples));