Skip to content

Conversation

@straight-shoota
Copy link
Member

@straight-shoota straight-shoota commented Aug 28, 2025

@straight-shoota straight-shoota self-assigned this Aug 28, 2025
@straight-shoota straight-shoota changed the title RFC: Time::Monotonic RFC 0015: Time::Monotonic Aug 28, 2025
@crysbot
Copy link

crysbot commented Aug 28, 2025

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

@straight-shoota straight-shoota changed the title RFC 0015: Time::Monotonic RFC 0015: Monotonic Time::Instant Nov 25, 2025
Copy link
Collaborator

@ysbaddaden ysbaddaden left a 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!

straight-shoota added a commit to crystal-lang/crystal that referenced this pull request Dec 11, 2025
Co-authored-by: Julien Portalier <[email protected]>
@ysbaddaden
Copy link
Collaborator

ysbaddaden commented Dec 19, 2025

My review is still the same: the RFC looks good, but we must see see and review how the integration fares before approval.

So far I believe there are still a couple unresolved questions: neither the internal clock nor counting sleep/suspend times are really abstract in practice, quite the opposite as we aim to have the same overall behavior (when possible) and need integration with system clocks for timers (to keep the behavior).

straight-shoota added a commit to crystal-lang/crystal that referenced this pull request Dec 21, 2025
)

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.
@crysbot
Copy link

crysbot commented Jan 1, 2026

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

Copy link
Collaborator

@ysbaddaden ysbaddaden left a 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) 👍

Blacksmoke16 added a commit to athena-framework/athena that referenced this pull request Jan 10, 2026
## 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`
PallasAthenaie pushed a commit to athena-framework/clock that referenced this pull request Jan 10, 2026
## 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`
PallasAthenaie pushed a commit to athena-framework/console that referenced this pull request Jan 10, 2026
## 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`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants