Skip to main content

CLOCK

Constant CLOCK 

Source
pub const CLOCK: ModuleSchema;
Expand description

clock: monotonic time, waiting, and work bounded or repeated in time.

timeout and every are both given work rather than data: the first takes the block it bounds as a trailing closure, and the second takes the body it repeats. Neither could be written before ADR 0013 added a way back into Cove, because a host call receives values and had no way to run one. Both declare that work HostType::Any: what it produces is the program’s business, not the clock’s.

Both are reads. Waiting leaves nothing outside the run different, and whatever the body does is charged where the body does it.