25#include <seastar/core/cacheline.hh>
27#include <seastar/util/modules.hh>
34SEASTAR_MODULE_EXPORT_BEGIN
41class lowres_system_clock;
58 using rep = std::chrono::steady_clock::rep;
59 using period = std::chrono::steady_clock::period;
60 using duration = std::chrono::steady_clock::duration;
61 using time_point = std::chrono::time_point<lowres_clock, duration>;
62 static constexpr bool is_steady =
true;
64#ifdef SEASTAR_BUILD_SHARED_LIBS
65 static thread_local time_point _now;
68 inline static thread_local time_point _now;
74 static time_point
now() noexcept {
78 static void update() noexcept;
92 using rep = std::chrono::system_clock::rep;
93 using period = std::chrono::system_clock::period;
94 using duration = std::chrono::system_clock::duration;
95 using time_point = std::chrono::time_point<lowres_system_clock, duration>;
96 static constexpr bool is_steady =
false;
98#ifdef SEASTAR_BUILD_SHARED_LIBS
99 static thread_local time_point _now;
102 inline static thread_local time_point _now;
109 static time_point
now() noexcept {
113 static std::time_t to_time_t(time_point t)
noexcept {
114 return std::chrono::duration_cast<std::chrono::seconds>(t.time_since_epoch()).count();
117 static time_point from_time_t(std::time_t t)
noexcept {
118 return time_point(std::chrono::duration_cast<duration>(std::chrono::seconds(t)));
122extern template class timer<lowres_clock>;
124SEASTAR_MODULE_EXPORT_END
Low-resolution and efficient steady clock.
Definition: lowres_clock.hh:56
static time_point now() noexcept
Definition: lowres_clock.hh:74
Low-resolution and efficient system clock.
Definition: lowres_clock.hh:90
static time_point now() noexcept
Definition: lowres_clock.hh:109
Seastar API namespace.
Definition: abort_on_ebadf.hh:26