quill
Classes | Public Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
detail::RdtscClock Class Reference

Converts tsc ticks to nanoseconds since epoch. More...

#include <RdtscClock.h>

Classes

struct  BaseTimeTsc
 
class  RdtscTicks
 A static class that calculates the rdtsc ticks per second. More...
 

Public Member Functions

 RdtscClock (std::chrono::nanoseconds resync_interval)
 
uint64_t time_since_epoch (uint64_t rdtsc_value) const noexcept
 
uint64_t time_since_epoch_safe (uint64_t rdtsc_value) const noexcept
 
bool resync (uint32_t lag) const noexcept
 
double nanoseconds_per_tick () const noexcept
 

Static Protected Member Functions

static QUILL_NODISCARD uint64_t _fast_average (uint64_t x, uint64_t y) noexcept
 

Protected Attributes

int64_t _resync_interval_ticks {0}
 
int64_t _resync_interval_original {0}
 stores the initial interval value as as if we fail to resync we increase the timer
 
double _ns_per_tick {0}
 
std::atomic< uint32_t > _version {0}
 
std::array< BaseTimeTsc, 2 > _base {}
 

Static Protected Attributes

static constexpr uint32_t resync_lag_cycles {50'000}
 

Detailed Description

Converts tsc ticks to nanoseconds since epoch.


The documentation for this class was generated from the following file: