mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-11-03 21:49:32 +01:00 
			
		
		
		
	Demote getCurrentNanosecondsSinceEpoch to internal linkage
This commit is contained in:
		@@ -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();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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:
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user