![]() |
Mbed OS Reference
|
Base class for Timer and LowPowerTimer. More...
#include <Timer.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. | |
Base class for Timer and LowPowerTimer.
| void start | ( | ) |
Start the timer.
Will lock deep sleep if this is a Timer instance
| void stop | ( | ) |
Stop the timer.
Will release the deep sleep lock if this is a Timer instance
| void reset | ( | ) |
Reset the timer to 0.
If it was already running, it will continue
| 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.
as std::chrono::microseconds