Feature #11124
closed
[PATCH] lib/*: use monotonic clock for timeouts
Added by normalperson (Eric Wong) almost 9 years ago.
Updated almost 9 years ago.
Description
The monotonic clock is preferred as it is guaranteed to be
continuous and not subject to jumps due to adjustments.
Given the identical "now" method in both files (and similar code in
lib/benchmark.rb), I wonder if we should implement something like
Process.now instead...
Anyways, I'll commit this patch as-is in a few weeks/months unless there's
objections.
Files
Just checking, which systems do we support do not have CLOCK_MONOTONIC
(emulated or otherwise).
We already emulate it with mach_absolute_time() and times(), so
I'd like to remove the defined? checks from stdlib if possible.
Thanks.
ref: https://bugs.ruby-lang.org/issues/11124
"NARUSE, Yui" naruse@airemix.jp wrote:
I don't know an environment which doesn't have CLOCK_MONOTONIC though it may be.
Committed as r50664. Lets hope everything is OK...
- Related to Bug #11225: r50776 + r50780 + r50781 changes behavior on systems without HAVE_STRUCT_MSGHDR_MSG_CONTROL added
- Related to deleted (Bug #11225: r50776 + r50780 + r50781 changes behavior on systems without HAVE_STRUCT_MSGHDR_MSG_CONTROL)
- Status changed from Open to Closed
Also available in: Atom
PDF
Like0
Like0Like0Like0Like0Like0Like0Like0