Mistake on this page?
Report an issue in GitHub or email us
Static Public Member Functions
HighResClock Class 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...
 

Detailed Description

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.

Note
To avoid the need to worry about locking, consider using the Timer, Ticker or Timeout classes, which lock automatically and only whenever they are active

Definition at line 49 of file HighResClock.h.

Member Function Documentation

static void lock ( void  )
static

Lock the clock to ensure it stays running.

Definition at line 65 of file HighResClock.h.

static time_point now ( )
static

Read the current time.

Definition at line 59 of file HighResClock.h.

static void unlock ( void  )
static

Unlock the clock, allowing it to stop during power saving.

Definition at line 71 of file HighResClock.h.

Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.