![]() |
Mbed OS Reference
|
Timer implementation using the LP ticker. More...
#include <LowPowerTimer.h>
Public Member Functions | |
| void | start () |
| Start the timer. | |
| void | stop () |
| Stop the timer. | |
| void | reset () |
| Reset the timer to 0. | |
| float | read () const |
| Get the time passed in seconds. | |
| int | read_ms () const |
| Get the time passed in milliseconds. | |
| int | read_us () const |
| Get the time passed in microseconds. | |
| operator float () const | |
| An operator shorthand for read() | |
| us_timestamp_t | read_high_resolution_us () const |
| Get (in a high resolution type) the time passed in microseconds. | |
| std::chrono::microseconds | elapsed_time () const |
| Get the time passed as chrono microseconds. | |
Timer implementation using the LP ticker.
Does not lock the deep sleep, and counts time correctly even while deep sleeping. However, provides less precision than Timer. The exact precision varies by target but will be between 250us and 15us.
Definition at line 40 of file LowPowerTimer.h.
|
inherited |
Start the timer.
Will lock deep sleep if this is a Timer instance
|
inherited |
Stop the timer.
Will release the deep sleep lock if this is a Timer instance
|
inherited |
Reset the timer to 0.
If it was already running, it will continue
|
inherited |
Get the time passed in seconds.
|
inherited |
Get the time passed in milliseconds.
|
inherited |
Get the time passed in microseconds.
|
inherited |
An operator shorthand for read()
|
inherited |
Get (in a high resolution type) the time passed in microseconds.
|
inherited |
Get the time passed as chrono microseconds.
as std::chrono::microseconds