Expand description
Sleep and timeout utilities that work natively (via tokio) and in the browser.
Structs§
- Duration
- A
Durationtype to represent a span of time, typically used for system timeouts. - Elapsed
- Errors returned by
Timeout. - Instant
- A measurement of a monotonically nondecreasing clock.
Opaque and useful only with
Duration. - Interval
- Interval returned by
intervalandinterval_at. - Sleep
- Future returned by
sleepandsleep_until. - System
Time - A measurement of the system clock, useful for talking to external entities like the file system or other processes.
- Timeout
- Future returned by
timeoutandtimeout_at.
Enums§
- Missed
Tick Behavior - Defines the behavior of an
Intervalwhen it misses a tick.
Functions§
- interval
- Creates new
Intervalthat yields with interval ofperiod. The first tick completes immediately. The defaultMissedTickBehaviorisBurst, but this can be configured by callingset_missed_tick_behavior. - interval_
at - Creates new
Intervalthat yields with interval ofperiodwith the first tick completing atstart. The defaultMissedTickBehaviorisBurst, but this can be configured by callingset_missed_tick_behavior. - sleep
- Waits until
durationhas elapsed. - sleep_
until - Waits until
deadlineis reached. - timeout
- Requires a
Futureto complete before the specified duration has elapsed.