/// WASI Monotonic Clock is a clock API intended to let users measure elapsed /// time. /// /// It is intended to be portable at least between Unix-family platforms and /// Windows. /// /// A monotonic clock is a clock which has an unspecified initial value, and /// successive reads of the clock will produce non-decreasing values. /// /// It is intended for measuring elapsed time. interface monotonic-clock { use wasi:io/poll@0.2.0-rc-2023-10-18.{pollable}; /// A timestamp in nanoseconds. type instant = u64; /// Read the current value of the clock. /// /// The clock is monotonic, therefore calling this function repeatedly will /// produce a sequence of non-decreasing values. now: func() -> instant; /// Query the resolution of the clock. resolution: func() -> instant; /// Create a `pollable` which will resolve once the specified time has been /// reached. subscribe: func( when: instant, absolute: bool ) -> pollable; }