Timer class where begin() and wait() are used to block for a given interval.
More...
#include <timer.hpp>
|
using | Clock_t = std::chrono::steady_clock |
|
using | Time_point = Clock_t::time_point |
|
using | Duration_t = std::chrono::milliseconds |
|
|
constexpr | Timer (Duration_t interval) |
| Construct a Timer with the given interval.
|
|
constexpr | Timer (FPS fps) |
| Construct a Timer with the given FPS interval.
|
|
void | begin () |
| Start the timer, returns immediately.
|
|
void | wait () |
| Sleep until the time interval is over, from last begin() call. More...
|
|
void | set_interval (Duration_t interval) |
| Set the amount of time to wait for from begin().
|
|
auto | get_interval () const -> Duration_t |
| Return the currently set interval.
|
|
Timer class where begin() and wait() are used to block for a given interval.
◆ wait()
Sleep until the time interval is over, from last begin() call.
Returns immediately if interval has already elapsed. Calling this without calling begin() first will return immediately.
The documentation for this class was generated from the following files:
- /github/workspace/include/termox/common/timer.hpp
- /github/workspace/src/common/timer.cpp