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

summaryrefslogtreecommitdiffhomepage
path: root/include/internal/catch_timer.cpp
diff options
context:
space:
mode:
authorPhil Nash2017-08-04 21:31:28 +0100
committerPhil Nash2017-08-04 21:31:28 +0100
commit97d6b08087b4afd335bfacfda0537581f6ef3f9b (patch)
treebd1460a55effaa69b89f89d9ac0fa9312c96dfa5 /include/internal/catch_timer.cpp
parenta9b6813ad9e423ddcd6559f52b503a68fe0f624c (diff)
downloadcatch3-97d6b08087b4afd335bfacfda0537581f6ef3f9b.tar.gz
Changed clock resolution estimator to return uint64_t
Diffstat (limited to 'include/internal/catch_timer.cpp')
-rw-r--r--include/internal/catch_timer.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/internal/catch_timer.cpp b/include/internal/catch_timer.cpp
index 9635ccea..ec1d8bb5 100644
--- a/include/internal/catch_timer.cpp
+++ b/include/internal/catch_timer.cpp
@@ -16,7 +16,7 @@ namespace Catch {
return std::chrono::duration_cast<std::chrono::nanoseconds>( std::chrono::high_resolution_clock::now().time_since_epoch() ).count();
}
- auto estimateClockResolution() -> double {
+ auto estimateClockResolution() -> uint64_t {
uint64_t sum = 0;
static const uint64_t iterations = 1000000;
@@ -35,9 +35,9 @@ namespace Catch {
// We're just taking the mean, here. To do better we could take the std. dev and exclude outliers
// - and potentially do more iterations if there's a high variance.
- return sum/(double)iterations;
+ return sum/iterations;
}
- auto getEstimatedClockResolution() -> double {
+ auto getEstimatedClockResolution() -> uint64_t {
static auto s_resolution = estimateClockResolution();
return s_resolution;
}