A C++11 chrono TrivialClock for os_timer. More...
#include <mbed_os_timer.h>
A C++11 chrono TrivialClock for os_timer.
Due to the nature of OsTimer/SysTimer, this does not have a single now
method, but has multiple ways to report the current state:
High-res timeline ------------------------------------------------------------- Ticks | a | b | b | b | c | c | c | c | c | d ^ ^ ^ ^ os_timer->get_time() acknowledged_ticks() reported_ticks() now()
(a) is time read from hardware by OsTimer, reported to the user of OsTimer, and acknowledged by that user. (b) is time read from hardware by OsTimer, reported to the user of OsTimer, but not yet acknowledged. (c) is time already elapsed in the hardware but yet to be read and processed as ticks by OsTimer. (d) is time already elapsed in the hardware that doesn't yet form a tick.
Time is "reported" either by:
As such now()
is used when the ticker is not in use - it processes ticks that would have been processed by the tick handler. If the ticker is in uses reported_ticks
or acknowleged_ticks
must be used.
Definition at line 71 of file mbed_os_timer.h.