OxL Reference

fn after

Runs body once after d (§17.4). Runs in the current task: it is cancelled with it.

Example:

oxl✓ checked in CI
use std.time { after }

fn main() io, time {
  after(20ms) { print("later") }
  print("done")
}
Output
later
done
pub(api) fn after<effect F>(d: Dur, body: fn() F) time, F

Thread safety. runs in the calling task; it is cancelled with it.

Since. 1.0.0-beta

Parameters

NameType
dDur
bodyfn() F

Effects

none declared (pure unless the body says otherwise)

Defined in: std/time/time.oxl:2515

See also