Adjust monotonic clocks to include suspended time with precision#16516
Conversation
|
I guess for the event loop we either have to switch to |
|
We need absolute timers in the event loop: while the event operation can be retried multiple times, the timeout is a fixed point in time. We could rework the epoll and io_uring evloops to recalculate a relative timeout every time but... to include suspend time we'd still have to tell timerfd and io_uring to use So, let's just use |
|
Neither NetBSD, OpenBSD or Solaris detail or guarantee whether their clock count suspended time. Shouldn't we use |
|
|
Implements clock adjustments as proposed in https://github.com/crystal-lang/rfcs/blob/rfc/time-monotonic/text/0015-time-monotonic.md#clock-implementation
We're using
CLOCK_MONOTONICeverywhere 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.