1- package wasi : clocks @ 0.3.0-rc-2025-08-15 ;
1+ package wasi : clocks @ 0.3.0-rc-2025-09-16 ;
22/// WASI Monotonic Clock is a clock API intended to let users measure elapsed
33/// time.
44///
@@ -7,38 +7,41 @@ package wasi:clocks@0.3.0-rc-2025-08-15;
77///
88/// A monotonic clock is a clock which has an unspecified initial value, and
99/// successive reads of the clock will produce non-decreasing values.
10- @since (version = 0.3.0-rc-2025-08-15 )
10+ @since (version = 0.3.0-rc-2025-09-16 )
1111interface monotonic-clock {
12+ use types . {duration };
13+
1214 /// An instant in time, in nanoseconds. An instant is relative to an
1315 /// unspecified initial value, and can only be compared to instances from
1416 /// the same monotonic-clock.
15- @since (version = 0.3.0-rc-2025-08-15 )
17+ @since (version = 0.3.0-rc-2025-09-16 )
1618 type instant = u64 ;
1719
18- /// A duration of time, in nanoseconds.
19- @since (version = 0.3.0-rc-2025-08-15 )
20- type duration = u64 ;
21-
2220 /// Read the current value of the clock.
2321 ///
2422 /// The clock is monotonic, therefore calling this function repeatedly will
2523 /// produce a sequence of non-decreasing values.
26- @since (version = 0.3.0-rc-2025-08-15 )
24+ ///
25+ /// For completeness, this function traps if it's not possible to represent
26+ /// the value of the clock in an `instant` . Consequently, implementations
27+ /// should ensure that the starting time is low enough to avoid the
28+ /// possibility of overflow in practice.
29+ @since (version = 0.3.0-rc-2025-09-16 )
2730 now : func () -> instant ;
2831
2932 /// Query the resolution of the clock. Returns the duration of time
3033 /// corresponding to a clock tick.
31- @since (version = 0.3.0-rc-2025-08-15 )
34+ @since (version = 0.3.0-rc-2025-09-16 )
3235 get-resolution : func () -> duration ;
3336
3437 /// Wait until the specified instant has occurred.
35- @since (version = 0.3.0-rc-2025-08-15 )
38+ @since (version = 0.3.0-rc-2025-09-16 )
3639 wait-until : async func (
3740 when : instant ,
3841 );
3942
40- /// Wait for the specified duration has elapsed .
41- @since (version = 0.3.0-rc-2025-08-15 )
43+ /// Wait for the specified duration to elapse .
44+ @since (version = 0.3.0-rc-2025-09-16 )
4245 wait-for : async func (
4346 how-long : duration ,
4447 );
0 commit comments