Module time
Available on crate feature
time only.Expand description
Provides time-related facilities.
Note: Even though some types from this module might be re-exports from third-party
crates (e.g., embassy-time), they are intended to be used “in a self-contained
way”—for instance, to sleep asynchronously:
Timer::after(Duration::from_secs(1)).await;
// or, equivalent but terser:
Timer::after_secs(1).await;Items from this module should not be passed as arguments to functions that expect
types from these third-party crates.
If such specific types are needed, please use those from ariel_os::reexports instead.
Structs§
- Delay
- Type implementing async delays and blocking
embedded-haldelays. - Duration
- Represents the difference between two Instants
- Instant
- An Instant in time, based on the MCU’s clock ticks since startup.
- Timeout
Error - Error returned by
with_timeoutandwith_deadlineon timeout. - Timer
- A future that completes at a specified Instant.
Constants§
- TICK_HZ
- Ticks per second of the global timebase.
Functions§
- with_
timeout - Runs a given future with a timeout.