pchickey opened PR #7358 from bytecodealliance:pch/monotonic-clock-duration to bytecodealliance:main:
Implement the interface change submitted upstream as https://github.com/WebAssembly/wasi-clocks/pull/53
We are introducing a
durationtype because it has a distinct meaning
frominstant: aninstantcan only be compared to otherinstants
from the exact samemonotonic-clock, whereas adurationrepresents
a duration of time which can be compared to any other duration of time.The
durationtype 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-instanttakes aninstanttype and
subscribe-durationtakes adurationtype.
pchickey requested alexcrichton for a review on PR #7358.
pchickey requested wasmtime-core-reviewers for a review on PR #7358.
alexcrichton submitted PR review.
alexcrichton submitted PR review.
alexcrichton created PR review comment:
Could this method perhaps delegate to
subscribe_durationor a similar helper once it calculates the relative desiredDuration? Or alternatively would it be possible to directly convert betweenwhenand atokio::time::Instant?It basically felt a bit odf that the
Nevercase was handled below but not here
pchickey updated PR #7358.
pchickey submitted PR review.
pchickey created PR review comment:
Thanks, I thought that over again and factored it out into a helper function.
pchickey requested alexcrichton for a review on PR #7358.
pchickey updated PR #7358.
alexcrichton submitted PR review.
pchickey updated PR #7358.
pchickey has enabled auto merge for PR #7358.
pchickey merged PR #7358.
Last updated: Dec 06 2025 at 06:05 UTC