diff --git a/imports.md b/imports.md index f82d3c1..1ec1fbe 100644 --- a/imports.md +++ b/imports.md @@ -62,7 +62,12 @@ successive reads of the clock will produce non-decreasing values.

#### `type instant` `u64` -

A timestamp in nanoseconds. +

An instant in time, in nanoseconds. An instant is relative to an +unspecified initial value, and can only be compared to instances from +the same monotonic-clock. +

type duration

+

u64

+

A duration of time, in nanoseconds.


Functions

now: func

@@ -74,22 +79,34 @@ produce a sequence of non-decreasing values.

  • instant
  • resolution: func

    -

    Query the resolution of the clock.

    +

    Query the resolution of the clock. Returns the duration of time +corresponding to a clock tick.

    +
    Return values
    + +

    subscribe-instant: func

    +

    Create a pollable which will resolve once the specified instant +occured.

    +
    Params
    +
    Return values
    -

    subscribe: func

    -

    Create a pollable which will resolve once the specified time has been -reached.

    +

    subscribe-duration: func

    +

    Create a pollable which will resolve once the given duration has +elapsed, starting at the time at which this function was called. +occured.

    Params
    Return values

    Import interface wasi:clocks/wall-clock

    WASI Wall Clock is a clock API intended to let users query the current