A C++11 Clock representing the HAL us_ticker. More...
|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.