Project

General

Profile

Actions

Feature #10138

closed

Access monotonic counter in Time

Added by cmouse (Aki Tuomi) over 9 years ago. Updated over 9 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
[ruby-core:64386]

Description

Provide API access to guaranteed monotonic counter on underlying operating system. Supports Windows XP and later, OS/X, any linux with clock_gettime.


Files

time-s-monotonic.patch (2.07 KB) time-s-monotonic.patch cmouse (Aki Tuomi), 08/15/2014 09:22 AM

Updated by normalperson (Eric Wong) over 9 years ago

wrote:

time-s-monotonic.patch (2.07 KB)

It might be better to put the OS compatibility code in the existing
Process.clock_gettime implementation

Updated by cmouse (Aki Tuomi) over 9 years ago

Eric Wong wrote:

wrote:

time-s-monotonic.patch (2.07 KB)

It might be better to put the OS compatibility code in the existing
Process.clock_gettime implementation

Not sure. It is not same as clock_gettime, which accepts parameters and such, and it is not clock_gettime across operating systems.

Also, the point of this patch is to enable access to uniform monotonic clock, so that you don't need to check for OS, what clock you want etc. Process.clock_gettime is simply method exposure, and I would think most people would not appreciate that on OS/X or Windows it does something completely different.

Updated by naruse (Yui NARUSE) over 9 years ago

  • Status changed from Open to Rejected

Aki Tuomi wrote:

Eric Wong wrote:

wrote:

time-s-monotonic.patch (2.07 KB)

It might be better to put the OS compatibility code in the existing
Process.clock_gettime implementation

Not sure. It is not same as clock_gettime, which accepts parameters and such, and it is not clock_gettime across operating systems.

Also, the point of this patch is to enable access to uniform monotonic clock, so that you don't need to check for OS, what clock you want etc. Process.clock_gettime is simply method exposure, and I would think most people would not appreciate that on OS/X or Windows it does something completely different.

Process.clock_gettime already have compatibility layer for OS X and Windows.
Therefore Process.clock_gettime(Process::CLOCK_MONOTONIC) is portable

Updated by cmouse (Aki Tuomi) over 9 years ago

Yui NARUSE wrote:

Aki Tuomi wrote:

Eric Wong wrote:

wrote:

time-s-monotonic.patch (2.07 KB)

It might be better to put the OS compatibility code in the existing
Process.clock_gettime implementation

Not sure. It is not same as clock_gettime, which accepts parameters and such, and it is not clock_gettime across operating systems.

Also, the point of this patch is to enable access to uniform monotonic clock, so that you don't need to check for OS, what clock you want etc. Process.clock_gettime is simply method exposure, and I would think most people would not appreciate that on OS/X or Windows it does something completely different.

Process.clock_gettime already have compatibility layer for OS X and Windows.
Therefore Process.clock_gettime(Process::CLOCK_MONOTONIC) is portable

So it would indeed seem, although I could not see Win32 listed as supported for CLOCK_MONOTONIC, but this could be just my misunderstanding. Thank you for the fast reply anyways!

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0