15namespace golxzn::os::chrono {
38template<
class BaseClock = utils::default_base_clock>
40 static_assert(BaseClock::is_steady,
41 "[golxzn::os::chrono::fast_clock] BaseClock is not a monotonic clock");
42 static_assert(utils::enough_resolution_v<BaseClock>,
43 "[golxzn::os::chrono::fast_clock] BaseClock's resolution is less than microseconds!");
67template<
class BaseClock = utils::default_base_clock>
69 static_assert(BaseClock::is_steady,
70 "[golxzn::os::chrono::clock] BaseClock is not a monotonic clock");
71 static_assert(utils::enough_resolution_v<BaseClock>,
72 "[golxzn::os::chrono::clock] BaseClock's resolution is less than microseconds!");
75 using base_clock = BaseClock;
76 using time_point =
typename base_clock::time_point;
77 static constexpr time_point zero{};
86 [[nodiscard]]
bool running() const noexcept;
134 time_point m_last_reset_time{ base_clock::now() };
135 time_point m_stop_time{ zero };
138#include "golxzn/os/chrono/impl/clock.inl"
Class that represents clock.In comparison with golxzn::os::chrono::fast_clock, it provides more funct...
Definition clock.hpp:68
time elapsed() const noexcept
Returns elapsed time since last reset or construction.
time reset() noexcept
Resets clock.
void start() noexcept
Starts clock.
void stop() noexcept
Stops clock.
time restart() noexcept
Restarts clock.
bool running() const noexcept
Returns true if clock is running.
Class that represents fast clock, which store only one time point.This class allows to measure time s...
Definition clock.hpp:39
typename base_clock::time_point time_point
Time point type from base clock.
Definition clock.hpp:47
BaseClock base_clock
Base clock type.
Definition clock.hpp:46
time elapsed() noexcept
Returns elapsed time since last call of elapsed() or since construction.
static constexpr time_point zero
Zero time point.
Definition clock.hpp:48
Class that represents time.
Definition time.hpp:30
Class that represents time.
Useful functions and aliases for golxzn::os::chrono.