Skip to content
This repository was archived by the owner on Nov 25, 2025. It is now read-only.

Commit c7f717e

Browse files
authored
add new types.wit package to hold duration (#98)
1 parent d3a35df commit c7f717e

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

wit-0.3.0-draft/monotonic-clock.wit

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,14 @@ package wasi:[email protected];
99
/// successive reads of the clock will produce non-decreasing values.
1010
@since(version = 0.3.0-rc-2025-08-15)
1111
interface 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.
1517
@since(version = 0.3.0-rc-2025-08-15)
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

wit-0.3.0-draft/types.wit

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package wasi:clocks@0.3.0-rc-2025-08-15;
2+
/// This interface common types used throughout wasi:clocks.
3+
@since(version = 0.3.0-rc-2025-08-15)
4+
interface types {
5+
/// A duration of time, in nanoseconds.
6+
@since(version = 0.3.0-rc-2025-08-15)
7+
type duration = u64;
8+
}

0 commit comments

Comments
 (0)