Available on
riot_module_ztimer
only.Expand description
§ztimer high level timer
ZTimer clocks are usually obtained by calling constructors that depend on the presence of global clocks – Clock::sec, Clock::msec and Clock::usec.
The methods usable on the clocks typically take durations in the form of Ticks, which ensure that time calculations are done early but can’t be mixed up between clocks. The sleep and spin methods take numeric tick counts and durations, not only for historical reasons, but also because sleeping for a Duration works infallibly (even if the duration exceeds the maximum number of ticks a timer can sleep) by sleeping in repetitions.
Modules§
- periodic
riot_module_ztimer_periodic
Structs§
- A clock that knows about its frequency. The pulse length is not given in core::time::Duration as that’s not yet supported by const generics, and because clock rates are often easier to express in Hertz than in multiples of 10^-n seconds.
- Delay
embedded-hal-async
andriot_module_ztimer_usec
Struct that provides the embedded_hal_async::delay::DelayNs trait - A Clock that has been acquired using Clock::acquire() (which is backed by ztimer_acquire). Times from a single acquired clock can be compared.
- The error type of fallible conversions to ticks.
- A duration on a clock of fixed speed
- A time on some clock ticking at a fixed speed