9 #include "quill/backend/BackendManager.h" 10 #include "quill/core/Attributes.h" 11 #include "quill/core/Rdtsc.h" 44 QUILL_NODISCARD QUILL_ATTRIBUTE_HOT uint64_t value()
const noexcept {
return _value; }
54 using duration = std::chrono::nanoseconds;
55 using rep = duration::rep;
56 using period = duration::period;
57 using time_point = std::chrono::time_point<BackendTscClock, duration>;
58 static constexpr
bool is_steady =
false;
64 QUILL_NODISCARD QUILL_ATTRIBUTE_HOT
static time_point
now() noexcept
66 uint64_t
const ts = detail::BackendManager::instance().convert_rdtsc_to_epoch_time(
detail::rdtsc());
68 return ts ? time_point{std::chrono::nanoseconds{ts}}
69 : time_point{std::chrono::nanoseconds{
70 std::chrono::time_point_cast<std::chrono::nanoseconds>(std::chrono::system_clock::now())
95 return time_point{std::chrono::nanoseconds{
96 detail::BackendManager::instance().convert_rdtsc_to_epoch_time(
rdtsc.value())}};
QUILL_NODISCARD static QUILL_ATTRIBUTE_HOT time_point to_time_point(RdtscVal rdtsc) noexcept
Converts a TSC (Time Stamp Counter) value to a wall clock timestamp.
Definition: BackendTscClock.h:93
A utility class for accessing the Time Stamp Counter (TSC) clock used by the backend logging thread...
Definition: BackendTscClock.h:33
QUILL_NODISCARD static QUILL_ATTRIBUTE_HOT time_point now() noexcept
Provides the current synchronized timestamp obtained using the TSC clock maintained by the backend lo...
Definition: BackendTscClock.h:64
QUILL_NODISCARD QUILL_ATTRIBUTE_HOT uint64_t rdtsc() noexcept
Get the TSC counter.
Definition: Rdtsc.h:109
Definition: BackendTscClock.h:36
QUILL_NODISCARD static QUILL_ATTRIBUTE_HOT RdtscVal rdtsc() noexcept
Returns the current value of the TSC timer maintained by the backend logging thread.
Definition: BackendTscClock.h:79