modm API documentation
|
Classes | |
struct | modm::chrono::micro_clock |
struct | modm::chrono::milli_clock |
Typedefs | |
using | modm::Clock = chrono::milli_clock |
using | modm::PreciseClock = chrono::micro_clock |
Functions | |
template<class C , class D > | |
modm::IOStream & | modm::operator<< (modm::IOStream &s, const std::chrono::time_point< C, D > &m) |
template<class T , class R > | |
modm::IOStream & | modm::operator<< (modm::IOStream &s, const std::chrono::duration< T, R > &m) |
lbuild module: modm:architecture:clock
To provide a system-wide time base this module provides two clocks:
modm::Clock
: a 32-bit unsigned millisecond clock running for approx. 49 days until wrap around, as an optimized replacement of std::chrono::system_clock
.modm::PreciseClock
: a 32-bit unsigned microsecond clock running for approx. 71 minutes until wrap around, as an optimized replacement of std::chrono::high_resolution_clock
.These clocks are intended to measure time intervals:
For additional common timeout and periodic timer use-cases also check out the modm:processing:timer
module which uses these clocks.
The clocks intended to be very lightweight to use, however, a few interface tradeoffs had to be made to achieve this goal.
Also check the modm:platform:clock
module descriptions for additional limitations on clock resolution and clock drift depending on target.