EtcPal  HEAD (unstable)
ETC Platform Abstraction Layer (EtcPal)
View other versions:
timer (Timers)

Overview

C++ utilities for the timer (Timers) module.

WARNING: This module must be explicitly initialized before use. Initialize the module by calling etcpal_init() with the relevant feature mask:

etcpal_error_t etcpal_init(etcpal_features_t features)
Initialize the EtcPal library.
Definition: common.c:112
#define ETCPAL_FEATURE_TIMERS
Use the etcpal/timer module.
Definition: common.h:139

NOTE: This module is intended to provide a platform-neutral time layer that is similar to the C++ standard library <chrono>. The advantage over <chrono> is that this module supports all EtcPal ports – including embedded RTOS platform with native tick counts.

Provides a class for representing points in time (TimePoint) and one which implements a passive monotonic timer (Timer).

Data Structures

class  TimePoint
 Represents a point in time. More...
 
class  Timer
 A wrapper class for the EtcPal timer type. More...
 

TimePoint operators

constexpr int32_t operator- (const TimePoint &a, const TimePoint &b) noexcept
 
constexpr bool operator== (const TimePoint &a, const TimePoint &b) noexcept
 
constexpr bool operator!= (const TimePoint &a, const TimePoint &b) noexcept
 
constexpr bool operator< (const TimePoint &a, const TimePoint &b) noexcept
 
constexpr bool operator> (const TimePoint &a, const TimePoint &b) noexcept
 
constexpr bool operator<= (const TimePoint &a, const TimePoint &b) noexcept
 
constexpr bool operator>= (const TimePoint &a, const TimePoint &b) noexcept