EtcPal
HEAD (unstable)
ETC Platform Abstraction Layer (EtcPal)
|
View other versions:
|
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:
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... | |
Functions | |
std::string | DurationToString (int32_t duration_ms) noexcept |
Get a string represention of a millisecond duration. 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 |
|
inlinenoexcept |
Get a string represention of a millisecond duration.
duration_ms | The millisecond duration (can be obtained by substracting two TimePoints, e.g. etcpal::TimePoint::Now() - tp). |