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> #include <chrono>
static const uint64_t nanosecondsInSecond = 1000000000;
namespace Catch { namespace Catch {
auto getCurrentNanosecondsSinceEpoch() -> uint64_t { namespace {
return std::chrono::duration_cast<std::chrono::nanoseconds>( std::chrono::high_resolution_clock::now().time_since_epoch() ).count(); 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() { void Timer::start() {
m_nanoseconds = getCurrentNanosecondsSinceEpoch(); m_nanoseconds = getCurrentNanosecondsSinceEpoch();

View File

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