Demote getCurrentNanosecondsSinceEpoch to internal linkage

This commit is contained in:
Martin Hořeňovský 2021-09-29 11:26:38 +02:00
parent 5250cf6d58
commit 2deafc33e9
No known key found for this signature in database
GPG Key ID: DE48307B8B0D381A
2 changed files with 5 additions and 7 deletions

View File

@ -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();

View File

@ -12,8 +12,6 @@
namespace Catch {
auto getCurrentNanosecondsSinceEpoch() -> uint64_t;
class Timer {
uint64_t m_nanoseconds = 0;
public: