A timer class to keep timeout states across AsyncComm related calls. More...
#include <Timer.h>
Public Member Functions | |
| Timer (uint32_t millis, bool start_timer=false) | |
| Constructor; assigns number of milliseconds after which the timer will expire. More... | |
| void | start () |
| Starts the timer. More... | |
| void | stop () |
| Stops the timer. More... | |
| void | reset (bool start_timer=false) |
| Resets the timer. More... | |
| uint32_t | remaining () |
| Returns the remaining time till expiry. More... | |
| bool | expired () |
| Returns true if the timer is expired. More... | |
| bool | is_running () |
| Returns true if the timer is still running (not yet expired. More... | |
| uint32_t | duration () |
| Returns the duration of the timer. More... | |
Private Attributes | |
| std::chrono::fast_clock::time_point | start_time |
| The time when the timer was started. More... | |
| bool | m_running |
| True if the timer is running. More... | |
| bool | m_started {} |
| True if the timer was started. More... | |
| std::chrono::fast_clock::duration | m_duration |
| The duration of the timer. More... | |
| std::chrono::fast_clock::duration | m_remaining |
| The remaining time till expiration. More... | |
A timer class to keep timeout states across AsyncComm related calls.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
|
private |
|
private |
|
private |
|
private |
1.8.8