Abstract stopwatch/timer base (Start/Elapsed/Completed) with selectable time base.
Use this when: you want a stopwatch object (start, delay, completed, elapsed) and you’ll choose the time base via a derived class.
Pick a derived class:
Abstract stopwatch/timer base (Start/Elapsed/Completed) with selectable time base.
More...
#include <SysTimer.h>
|
| void | SetDelay (uint32_t delay) |
| | Set the delay of the timer.
|
| |
| void | Start (uint32_t delay) |
| | Starts the timer with a delay argument.
|
| |
|
void | Start () |
| | Starts the timer with the default or configured delay.
|
| |
| bool | Completed () |
| | Check to see if the timer has completed.
|
| |
| uint32_t | Elapsed () |
| | Check how much time has elapsed since the start of the timer.
|
| |
◆ Completed()
| bool ClearCore::SysTimer::Completed |
( |
| ) |
|
|
inline |
Check to see if the timer has completed.
- Note
- The timer will roll over after UINT32_MAX ticks have passed since starting the timer. You should be mindful of this rollover when choosing a time base for an application (every ~49.7 days for milliseconds, every ~71.5 minutes for microseconds)
- Returns
- True if the timer has completed
◆ Elapsed()
| uint32_t ClearCore::SysTimer::Elapsed |
( |
| ) |
|
|
inline |
Check how much time has elapsed since the start of the timer.
- Note
- The elapsed time will roll over after UINT32_MAX ticks have passed since starting the timer. You should be mindful of this rollover when choosing a time base for an application (every ~49.7 days for milliseconds, every ~71.5 minutes for microseconds)
- Returns
- The time elapsed in the time base of the timer class
◆ SetDelay()
| void ClearCore::SysTimer::SetDelay |
( |
uint32_t |
delay | ) |
|
|
inline |
Set the delay of the timer.
- Parameters
-
| [in] | delay | The delay for the timer in the time base of the timer class |
◆ Start()
| void ClearCore::SysTimer::Start |
( |
uint32_t |
delay | ) |
|
|
inline |
Starts the timer with a delay argument.
- Parameters
-
| [in] | delay | The delay for the timer in the time base of the timer class |
The documentation for this class was generated from the following file: