Skip to content

Commit 8c12295

Browse files
committed
Rename "instant" to "monotonic-clock-point"
Other possibilities: "monotonic-time", "clock-point" (if the "monotonic-clock" namespace is sufficient and we don't need to repeat 'monotonic'), "timestamp". Also renames monotonic-clock::subscribe-instant to subscribe-clock-point. Other possibilities: "subscribe-monotonic-clock-point", "subscribe-time", "subscribe-monotonic-time", "subscribe-timestamp".
1 parent 2454ae6 commit 8c12295

File tree

3 files changed

+17
-16
lines changed

3 files changed

+17
-16
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,14 @@ default-monotonic-clock: monotonic-clock
6666
```
6767

6868
```rust
69-
let start: Instant = monotonic_clock::now(clock);
69+
let start: MonotonicClockPoint = monotonic_clock::now(clock);
7070

7171
// some stuff
7272

73-
let stop: Instant = monotonic_clock::now(clock);
73+
let stop: MonotonicClockPoint = monotonic_clock::now(clock);
7474

75-
let elapsed: Instant = stop - start;
75+
let elapsed: MonotonicClockPoint = stop - start;
76+
// NOTE: should be `elapsed: Duration`?
7677
```
7778

7879

imports.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ successive reads of the clock will produce non-decreasing values.</p>
7171
<h4><a name="pollable"></a><code>type pollable</code></h4>
7272
<p><a href="#pollable"><a href="#pollable"><code>pollable</code></a></a></p>
7373
<p>
74-
#### <a name="instant"></a>`type instant`
74+
#### <a name="monotonic_clock_point"></a>`type monotonic-clock-point`
7575
`u64`
76-
<p>An instant in time, in nanoseconds. An instant is relative to an
76+
<p>A monotonic clock point in nanoseconds. A clock point is relative to an
7777
unspecified initial value, and can only be compared to instances from
7878
the same monotonic-clock.
7979
<h4><a name="duration"></a><code>type duration</code></h4>
@@ -87,7 +87,7 @@ the same monotonic-clock.
8787
produce a sequence of non-decreasing values.</p>
8888
<h5>Return values</h5>
8989
<ul>
90-
<li><a name="now.0"></a> <a href="#instant"><a href="#instant"><code>instant</code></a></a></li>
90+
<li><a name="now.0"></a> <a href="#monotonic_clock_point"><a href="#monotonic_clock_point"><code>monotonic-clock-point</code></a></a></li>
9191
</ul>
9292
<h4><a name="resolution"></a><code>resolution: func</code></h4>
9393
<p>Query the resolution of the clock. Returns the duration of time
@@ -96,16 +96,16 @@ corresponding to a clock tick.</p>
9696
<ul>
9797
<li><a name="resolution.0"></a> <a href="#duration"><a href="#duration"><code>duration</code></a></a></li>
9898
</ul>
99-
<h4><a name="subscribe_instant"></a><code>subscribe-instant: func</code></h4>
100-
<p>Create a <a href="#pollable"><code>pollable</code></a> which will resolve once the specified instant
99+
<h4><a name="subscribe_clock_point"></a><code>subscribe-clock-point: func</code></h4>
100+
<p>Create a <a href="#pollable"><code>pollable</code></a> which will resolve once the specified clock point
101101
has occured.</p>
102102
<h5>Params</h5>
103103
<ul>
104-
<li><a name="subscribe_instant.when"></a><code>when</code>: <a href="#instant"><a href="#instant"><code>instant</code></a></a></li>
104+
<li><a name="subscribe_clock_point.when"></a><code>when</code>: <a href="#monotonic_clock_point"><a href="#monotonic_clock_point"><code>monotonic-clock-point</code></a></a></li>
105105
</ul>
106106
<h5>Return values</h5>
107107
<ul>
108-
<li><a name="subscribe_instant.0"></a> own&lt;<a href="#pollable"><a href="#pollable"><code>pollable</code></a></a>&gt;</li>
108+
<li><a name="subscribe_clock_point.0"></a> own&lt;<a href="#pollable"><a href="#pollable"><code>pollable</code></a></a>&gt;</li>
109109
</ul>
110110
<h4><a name="subscribe_duration"></a><code>subscribe-duration: func</code></h4>
111111
<p>Create a <a href="#pollable"><code>pollable</code></a> that will resolve after the specified duration has

wit/monotonic-clock.wit

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ interface monotonic-clock {
1212
@since(version = 0.2.0)
1313
use wasi:io/poll@0.2.0.{pollable};
1414

15-
/// An instant in time, in nanoseconds. An instant is relative to an
15+
/// A monotonic clock point in nanoseconds. A clock point is relative to an
1616
/// unspecified initial value, and can only be compared to instances from
1717
/// the same monotonic-clock.
1818
@since(version = 0.2.0)
19-
type instant = u64;
19+
type monotonic-clock-point = u64;
2020

2121
/// A duration of time, in nanoseconds.
2222
@since(version = 0.2.0)
@@ -27,18 +27,18 @@ interface monotonic-clock {
2727
/// The clock is monotonic, therefore calling this function repeatedly will
2828
/// produce a sequence of non-decreasing values.
2929
@since(version = 0.2.0)
30-
now: func() -> instant;
30+
now: func() -> monotonic-clock-point;
3131

3232
/// Query the resolution of the clock. Returns the duration of time
3333
/// corresponding to a clock tick.
3434
@since(version = 0.2.0)
3535
resolution: func() -> duration;
3636

37-
/// Create a `pollable` which will resolve once the specified instant
37+
/// Create a `pollable` which will resolve once the specified clock point
3838
/// has occured.
3939
@since(version = 0.2.0)
40-
subscribe-instant: func(
41-
when: instant,
40+
subscribe-clock-point: func(
41+
when: monotonic-clock-point,
4242
) -> pollable;
4343

4444
/// Create a `pollable` that will resolve after the specified duration has

0 commit comments

Comments
 (0)