30 lines
470 B
Plaintext
30 lines
470 B
Plaintext
package wasi:clocks@0.2.0;
|
|
|
|
interface monotonic-clock {
|
|
use wasi:io/poll@0.2.0.{pollable};
|
|
|
|
type instant = u64;
|
|
|
|
type duration = u64;
|
|
|
|
now: func() -> instant;
|
|
|
|
resolution: func() -> duration;
|
|
|
|
subscribe-instant: func(when: instant) -> pollable;
|
|
|
|
subscribe-duration: func(when: duration) -> pollable;
|
|
}
|
|
|
|
interface wall-clock {
|
|
record datetime {
|
|
seconds: u64,
|
|
nanoseconds: u32,
|
|
}
|
|
|
|
now: func() -> datetime;
|
|
|
|
resolution: func() -> datetime;
|
|
}
|
|
|