RFC 0015: Monotonic Time::Instant#15
Conversation
|
This pull request has been mentioned on Crystal Forum. There might be relevant details there: https://forum.crystal-lang.org/t/ambiguous-use-of-time-span-for-duration-and-monotonic-clock/8324/13 |
Time::MonotonicTime::Instant
ysbaddaden
left a comment
There was a problem hiding this comment.
Looks good 👍
Let's see how an implementation would fare, now!
Implements [RFC 15](crystal-lang/rfcs#15)
Co-authored-by: Julien Portalier <julien@portalier.com>
|
My review is still the same: the RFC looks good, but we must see see and review how the integration fares before approval.
|
) Implements clock adjustments as proposed in [RFC 0015](crystal-lang/rfcs#15). We're using `CLOCK_MONOTONIC` everywhere except Linux (where it doesn't tick while suspended) and darwin (where resolution is only 1 microsecond). This is a breaking change on both Linux and darwin where we previously used clocks that don't count suspended or sleeping time.
|
This pull request has been mentioned on Crystal Forum. There might be relevant details there: https://forum.crystal-lang.org/t/ambiguous-use-of-time-span-for-duration-and-monotonic-clock/8324/17 |
ysbaddaden
left a comment
There was a problem hiding this comment.
I believe it's done (minus one cleanup) 👍
## Context `Time.monotonic` has been [deprecated](crystal-lang/rfcs#15) in Crystal stdlib. The new `Time.instant` API doesn't, for good reason, doesn't have any overlap with `Time`, thus making it somewhat incompatible with `ACLK::Interface`. Instead of trying to hack in some solution using `Time.instant`, this PR just removes the monotonic clock. If/when there is a usecase that comes up that would benefit from it. We could explore our options at that point. ## Changelog - Remove `ACLK::Monotonic` - Update `console` usages to use `ACLK::Native`
## Context `Time.monotonic` has been [deprecated](crystal-lang/rfcs#15) in Crystal stdlib. The new `Time.instant` API doesn't, for good reason, doesn't have any overlap with `Time`, thus making it somewhat incompatible with `ACLK::Interface`. Instead of trying to hack in some solution using `Time.instant`, this PR just removes the monotonic clock. If/when there is a usecase that comes up that would benefit from it. We could explore our options at that point. ## Changelog - Remove `ACLK::Monotonic` - Update `console` usages to use `ACLK::Native`
## Context `Time.monotonic` has been [deprecated](crystal-lang/rfcs#15) in Crystal stdlib. The new `Time.instant` API doesn't, for good reason, doesn't have any overlap with `Time`, thus making it somewhat incompatible with `ACLK::Interface`. Instead of trying to hack in some solution using `Time.instant`, this PR just removes the monotonic clock. If/when there is a usecase that comes up that would benefit from it. We could explore our options at that point. ## Changelog - Remove `ACLK::Monotonic` - Update `console` usages to use `ACLK::Native`
Co-authored-by: Julien Portalier <julien@portalier.com>
Preview: https://github.com/crystal-lang/rfcs/blob/rfc/time-monotonic/text/0015-time-monotonic.md