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

summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorMartin Hořeňovský2021-09-29 11:26:38 +0200
committerMartin Hořeňovský2021-09-29 11:26:38 +0200
commit2deafc33e923fb2bf6f4c0ffb1772c109001d5b9 (patch)
tree9c4d1e0041797eedf4e13c586b68509e01364f69 /src
parent5250cf6d580fd85643aa2f6008f3f1adb7dda03e (diff)
downloadcatch3-2deafc33e923fb2bf6f4c0ffb1772c109001d5b9.tar.gz
Demote getCurrentNanosecondsSinceEpoch to internal linkage
Diffstat (limited to 'src')
-rw-r--r--src/catch2/catch_timer.cpp10
-rw-r--r--src/catch2/catch_timer.hpp2
2 files changed, 5 insertions, 7 deletions
diff --git a/src/catch2/catch_timer.cpp b/src/catch2/catch_timer.cpp
index 8084352e..d67d94ca 100644
--- a/src/catch2/catch_timer.cpp
+++ b/src/catch2/catch_timer.cpp
@@ -9,13 +9,13 @@
#include <chrono>
-static const uint64_t nanosecondsInSecond = 1000000000;
-
namespace Catch {
- auto getCurrentNanosecondsSinceEpoch() -> uint64_t {
- return std::chrono::duration_cast<std::chrono::nanoseconds>( std::chrono::high_resolution_clock::now().time_since_epoch() ).count();
- }
+ namespace {
+ static auto getCurrentNanosecondsSinceEpoch() -> uint64_t {
+ return std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::high_resolution_clock::now().time_since_epoch()).count();
+ }
+ } // end unnamed namespace
void Timer::start() {
m_nanoseconds = getCurrentNanosecondsSinceEpoch();
diff --git a/src/catch2/catch_timer.hpp b/src/catch2/catch_timer.hpp
index 66aab87b..30e81415 100644
--- a/src/catch2/catch_timer.hpp
+++ b/src/catch2/catch_timer.hpp
@@ -12,8 +12,6 @@
namespace Catch {
- auto getCurrentNanosecondsSinceEpoch() -> uint64_t;
-
class Timer {
uint64_t m_nanoseconds = 0;
public: