Expand description
The native time module for the Rune Language.
§Usage
Add the following to your Cargo.toml:
rune-modules = { version = "0.14.1", features = ["time"] }Install it into your context:
let mut context = rune::Context::with_default_modules()?;
context.install(rune_modules::time::module(true)?)?;Use it in Rune:
ⓘ
use time;
fn main() {
time::sleep(time::Duration::from_secs(10)).await;
println("Message after 10 seconds!");
}Structs§
- Duration
- A
Durationtype to represent a span of time, typically used for system timeouts. - Instant
- A measurement of a monotonically nondecreasing clock.
Opaque and useful only with
Duration. - Interval
- Interval returned by [
interval] and [interval_at].
Functions§
- module
- Construct the
timemodule.