Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce monotonic-clock duration #53

Merged
merged 2 commits into from
Oct 31, 2023
Merged

Introduce monotonic-clock duration #53

merged 2 commits into from
Oct 31, 2023

Conversation

pchickey
Copy link
Collaborator

@pchickey pchickey commented Oct 25, 2023

We are introducing a duration type because it has a distinct meaning from instant: an instant can only be compared to other instants from the exact same monotonic-clock, whereas a duration represents a duration of time which can be compared to any other duration of time.

The duration type is motivated, in part, by a desire to reuse it to specify durations such as timeouts in other WASI proposals.

Instead of subscribe taking a boolean specifying whether the u64 is an absolute or relative time, we have split it into two functions: subscribe-instant takes an instant type, and subscribe-duration takes a duration type.

Pat Hickey added 2 commits October 24, 2023 17:05
We are introducing a `duration` type because it has a distinct meaning
from `instant`: an `instant` can only be compared to other `instant`s
from the exact same `monotonic-clock`, whereas a `duration` represents
a duration of time which can be compared to any other duration of time.

The `duration` type is motivated, in part, by a desire to reuse it to
specify durations such as timeouts in other WASI proposals.

Instead of taking a boolean specifying whether the u64 is an absolute or
relative time, `subscribe-instant` takes an `instant` type and
`subscribe-duration` takes a `duration` type.
@sunfishcode sunfishcode merged commit 920b60d into main Oct 31, 2023
@sunfishcode sunfishcode deleted the pch/duration branch October 31, 2023 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants