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-12-08 15:57:36 +0000
committerPhil Nash2017-12-08 15:59:00 +0000
commit4da655c1b06ec238ed63424bbc0e2a6f80f9d63a (patch)
treee985ca8e79ce25c9ece0192208c9e956db2d9823 /include/internal/catch_timer.cpp
parentc4d1aa90337300a8c7646b3f28b0a6783eec5a8f (diff)
downloadcatch3-4da655c1b06ec238ed63424bbc0e2a6f80f9d63a.tar.gz
Increased int size for timers to avoid truncations
Diffstat (limited to 'include/internal/catch_timer.cpp')
-rw-r--r--include/internal/catch_timer.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/internal/catch_timer.cpp b/include/internal/catch_timer.cpp
index a6f37e8e..0057cc39 100644
--- a/include/internal/catch_timer.cpp
+++ b/include/internal/catch_timer.cpp
@@ -9,6 +9,7 @@
#include "catch_timer.h"
#include <chrono>
+#include <iostream>
namespace Catch {
@@ -45,11 +46,11 @@ namespace Catch {
void Timer::start() {
m_nanoseconds = getCurrentNanosecondsSinceEpoch();
}
- auto Timer::getElapsedNanoseconds() const -> unsigned int {
- return static_cast<unsigned int>(getCurrentNanosecondsSinceEpoch() - m_nanoseconds);
+ auto Timer::getElapsedNanoseconds() const -> uint64_t {
+ return getCurrentNanosecondsSinceEpoch() - m_nanoseconds;
}
- auto Timer::getElapsedMicroseconds() const -> unsigned int {
- return static_cast<unsigned int>(getElapsedNanoseconds()/1000);
+ auto Timer::getElapsedMicroseconds() const -> uint64_t {
+ return getElapsedNanoseconds()/1000;
}
auto Timer::getElapsedMilliseconds() const -> unsigned int {
return static_cast<unsigned int>(getElapsedMicroseconds()/1000);