13static const uint64_t nanosecondsInSecond = 1000000000;
18 return std::chrono::duration_cast<std::chrono::nanoseconds>( std::chrono::high_resolution_clock::now().time_since_epoch() ).count();
22 auto estimateClockResolution() ->
uint64_t {
24 static const uint64_t iterations = 1000000;
28 for( std::size_t i = 0; i < iterations; ++i ) {
34 }
while( ticks == baseTicks );
36 auto delta = ticks - baseTicks;
42 if (ticks > startTime + 3 * nanosecondsInSecond) {
43 return sum / ( i + 1u );
49 return sum/iterations;
53 static auto s_resolution = estimateClockResolution();
auto getElapsedSeconds() const -> double
auto getElapsedMilliseconds() const -> unsigned int
auto getElapsedMicroseconds() const -> uint64_t
auto getElapsedNanoseconds() const -> uint64_t
auto getCurrentNanosecondsSinceEpoch() -> uint64_t
auto getEstimatedClockResolution() -> uint64_t
unsigned __int64 uint64_t