|
constexpr | fast_timer (const time timer_interval) noexcept |
| fast_timer constructor from timer interval.
|
|
constexpr | fast_timer (const time_point timer_interval) noexcept |
| fast_timer constructor from timer interval.
|
|
template<class Rep , class Period > |
constexpr | fast_timer (const std::chrono::duration< Rep, Period > timer_interval) noexcept |
| fast_timer constructor from timer interval.
|
|
constexpr bool | is_done () const noexcept |
| Returns true if timer is done.
|
|
constexpr bool | is_running () const noexcept |
| Returns true if timer is running.
|
|
constexpr time | time_left () const noexcept |
| Returns time left to the end of the timer.
|
|
template<class BaseClock = utils::default_base_clock>
class golxzn::os::chrono::fast_timer< BaseClock >
Class that represents fast_timer.
Compared to golxzn::os::chrono::timer it doesn't use a thread and callback.
- Template Parameters
-
BaseClock | clock that will be used for measurement. It has to be monotonic and STL compatible. |
This class is used to measure time. It doesn't use a thread and callback. It stores only start time and timer interval, which is passing in constructor. So it's very lightweight. It's just check if the creating time + interval is less than current time.
Example of using:
}
Class that represents fast_timer.
Definition timer.hpp:169
Class that represents timer.
Definition timer.hpp:60
time time_left() const noexcept
Returns time left to the end of the timer.
bool is_running() const noexcept
Returns true if timer is running.