24 #ifndef SEASTAR_MODULE
25 #include <seastar/core/cacheline.hh>
27 #include <seastar/util/modules.hh>
37 SEASTAR_MODULE_EXPORT_BEGIN
44 class lowres_system_clock;
61 using rep = std::chrono::steady_clock::rep;
62 using period = std::chrono::steady_clock::period;
63 using duration = std::chrono::steady_clock::duration;
64 using time_point = std::chrono::time_point<lowres_clock, duration>;
65 static constexpr
bool is_steady =
true;
67 #ifdef SEASTAR_BUILD_SHARED_LIBS
68 static thread_local time_point _now;
71 inline static thread_local time_point _now;
77 static time_point
now() noexcept {
81 static void update() noexcept;
95 using rep = std::chrono::system_clock::rep;
96 using period = std::chrono::system_clock::period;
97 using duration = std::chrono::system_clock::duration;
98 using time_point = std::chrono::time_point<lowres_system_clock, duration>;
99 static constexpr
bool is_steady =
false;
101 #ifdef SEASTAR_BUILD_SHARED_LIBS
102 static thread_local time_point _now;
105 inline static thread_local time_point _now;
112 static time_point
now() noexcept {
116 static std::time_t to_time_t(time_point t) noexcept {
117 return std::chrono::duration_cast<std::chrono::seconds>(t.time_since_epoch()).count();
120 static time_point from_time_t(std::time_t t) noexcept {
121 return time_point(std::chrono::duration_cast<duration>(std::chrono::seconds(t)));
125 extern template class timer<lowres_clock>;
127 SEASTAR_MODULE_EXPORT_END
Low-resolution and efficient steady clock.
Definition: lowres_clock.hh:59
static time_point now() noexcept
Definition: lowres_clock.hh:77
Low-resolution and efficient system clock.
Definition: lowres_clock.hh:93
static time_point now() noexcept
Definition: lowres_clock.hh:112
Seastar API namespace.
Definition: abort_on_ebadf.hh:26