Mbed OS Reference
|
A C++11 Clock representing the HAL us_ticker. More...
#include <HighResClock.h>
Static Public Member Functions | |
static time_point | now () |
Read the current time. More... | |
static void | lock () |
Lock the clock to ensure it stays running. More... | |
static void | unlock () |
Unlock the clock, allowing it to stop during power saving. More... | |
A C++11 Clock representing the HAL us_ticker.
The high resolution clock will pause whenever deep sleep is entered.
Lock and unlock methods are provided to control deep sleep to keep the clock running. LowPowerClock provides the same methods as dummies to support generic code that works with either clock.
Locks and unlocks are passed to the deep sleep manager, so are reference counted.
The lock and unlock methods mean this is a C++11 BasicLockable class, so scoped_lock<HighResClock> or unique_lock<HighResClock> could be used to manage ownership and guarantee balanced unlocking.
Definition at line 49 of file HighResClock.h.
|
static |
Read the current time.
Definition at line 59 of file HighResClock.h.
|
static |
Lock the clock to ensure it stays running.
Definition at line 65 of file HighResClock.h.
|
static |
Unlock the clock, allowing it to stop during power saving.
Definition at line 71 of file HighResClock.h.