2026-07-27 04:59:33 +08:00
|
|
|
package wasmeld:clock@0.1.0;
|
|
|
|
|
|
2026-07-30 08:13:24 +08:00
|
|
|
/// Actor-local monotonic time for measuring elapsed durations.
|
2026-07-27 04:59:33 +08:00
|
|
|
interface monotonic-clock {
|
2026-07-30 08:13:24 +08:00
|
|
|
/// Returns nanoseconds elapsed since this Actor Store was created.
|
|
|
|
|
///
|
|
|
|
|
/// The value is monotonic and saturates at `u64::MAX`. It is not Unix time,
|
|
|
|
|
/// cannot be compared across Actor restarts, and must not be persisted as a
|
|
|
|
|
/// wall-clock timestamp.
|
2026-07-27 04:59:33 +08:00
|
|
|
now: func() -> u64;
|
|
|
|
|
}
|
|
|
|
|
|
2026-07-30 08:13:24 +08:00
|
|
|
/// Host-side world used by Wasmeld to link the clock implementation.
|
2026-07-27 04:59:33 +08:00
|
|
|
world clock-host {
|
|
|
|
|
import monotonic-clock;
|
|
|
|
|
}
|