Project

General

Profile

Actions

Feature #8777

closed

Process.mach_absolute_time

Added by tenderlovemaking (Aaron Patterson) over 10 years ago. Updated over 2 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:56551]

Description

Hi,

This is related to #8658. mach_absolute_time will give us a monotonic clock on OS X. I'm not sure if this fits in to clock_gettime, so I've added a new function for getting the absolute time and another function for converting the absolute time to nanoseconds.

/cc @akr (Akira Tanaka)


Files

mach_absolute.patch (2.81 KB) mach_absolute.patch tenderlovemaking (Aaron Patterson), 08/11/2013 06:23 PM

Related issues 1 (0 open1 closed)

Related to Ruby master - Feature #8658: Process.clock_gettimeClosed07/19/2013Actions

Updated by akr (Akira Tanaka) over 10 years ago

2013/8/11 tenderlovemaking (Aaron Patterson) :

Feature #8777: Process.mach_absolute_time
https://bugs.ruby-lang.org/issues/8777

This is related to #8658. mach_absolute_time will give us a monotonic clock on OS X. I'm not sure if this fits in to clock_gettime, so I've added a new function for getting the absolute time and another function for converting the absolute time to nanoseconds.

I think that "I'm not sure if this fits in to clock_gettime" is
too weak reason to introduce new methods.

Tanaka Akira

Updated by tenderlovemaking (Aaron Patterson) over 10 years ago

On Sun, Aug 11, 2013 at 09:46:41PM +0900, Tanaka Akira wrote:

2013/8/11 tenderlovemaking (Aaron Patterson) :

Feature #8777: Process.mach_absolute_time
https://bugs.ruby-lang.org/issues/8777

This is related to #8658. mach_absolute_time will give us a monotonic clock on OS X. I'm not sure if this fits in to clock_gettime, so I've added a new function for getting the absolute time and another function for converting the absolute time to nanoseconds.

I think that "I'm not sure if this fits in to clock_gettime" is
too weak reason to introduce new methods.

Sorry, I'm asking for help. I don't know how to fit it in with
clock_gettime. Can you help me?

mach_absolute_time requires a conversion to obtain nanoseconds, but it
seems the other clocks do not.

--
Aaron Patterson
http://tenderlovemaking.com/

Updated by tenderlovemaking (Aaron Patterson) over 10 years ago

On Fri, Aug 16, 2013 at 02:43:33PM +0900, naruse (Yui NARUSE) wrote:

Issue #8777 has been updated by naruse (Yui NARUSE).

Status changed from Open to Closed

Oops, I didn't notice this ticket.

I committed mach_absolute_time at r42573 as a part of get_clocktime with Process::CLOCK_MONOTONIC

http://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_getres.html
https://developer.apple.com/library/mac/documentation/Darwin/Conceptual/KernelProgramming/services/services.html#//apple_ref/doc/uid/TP30000905-CH219-BEHJDFCA
https://developer.apple.com/library/mac/qa/qa1398/_index.html
http://www.python.org/dev/peps/pep-0418/#monotonic-clocks

Ah great! My repo is just far behind. Thank you! <3<3

--
Aaron Patterson
http://tenderlovemaking.com/

Actions #5

Updated by hsbt (Hiroshi SHIBATA) over 2 years ago

  • Project changed from 14 to Ruby master
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0