-
-
Notifications
You must be signed in to change notification settings - Fork 8
RFC 0015: Monotonic Time::Instant
#15
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
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍
Let's see how an implementation would fare, now!
Implements [RFC 15](crystal-lang/rfcs#15)
Co-authored-by: Julien Portalier <[email protected]>
|
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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`
Preview: https://github.com/crystal-lang/rfcs/blob/rfc/time-monotonic/text/0015-time-monotonic.md