[前][次][番号順一覧][スレッド一覧]

ruby-changes:30515

From: eregon <ko1@a...>
Date: Sat, 17 Aug 2013 20:13:07 +0900 (JST)
Subject: [ruby-changes:30515] eregon:r42594 (trunk): * process.c: [DOC] MACH_ABSOLUTE_TIME_CLOCK_MONOTONIC is an

eregon	2013-08-17 20:13:01 +0900 (Sat, 17 Aug 2013)

  New Revision: 42594

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42594

  Log:
    * process.c: [DOC] MACH_ABSOLUTE_TIME_CLOCK_MONOTONIC is an
      available emulation for a monotonic clock on Darwin.
      https://developer.apple.com/library/mac/qa/qa1398/_index.html

  Modified files:
    trunk/ChangeLog
    trunk/process.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 42593)
+++ ChangeLog	(revision 42594)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Aug 17 20:11:49 2013  Benoit Daloze  <eregontp@g...>
+
+	* process.c: [DOC] MACH_ABSOLUTE_TIME_CLOCK_MONOTONIC is an
+	  available emulation for a monotonic clock on Darwin.
+	  https://developer.apple.com/library/mac/qa/qa1398/_index.html
+
 Fri Aug 16 18:12:05 2013  Koichi Sasada  <ko1@a...>
 
 	* test/profile_test_all.rb: fix typo.
Index: process.c
===================================================================
--- process.c	(revision 42593)
+++ process.c	(revision 42594)
@@ -6671,14 +6671,20 @@ rb_proc_times(VALUE obj) https://github.com/ruby/ruby/blob/trunk/process.c#L6671
  *  [CLOCK_UPTIME_PRECISE] FreeBSD 8.1
  *  [CLOCK_SECOND] FreeBSD 8.1
  *
- *  Also, several symbols are accepted as +clock_id+.
- *  They may be used as emulation for clock_gettime().
+ *  Also, several other symbols are accepted as +clock_id+.
+ *  There are emulations for clock_gettime().
+ *
  *  For example, Process::CLOCK_REALTIME is defined as
  *  +:POSIX_GETTIMEOFDAY_CLOCK_REALTIME+ when clock_gettime() is not available.
  *
+ *  Emulations for +:CLOCK_REALTIME+:
  *  [:POSIX_GETTIMEOFDAY_CLOCK_REALTIME] Use gettimeofday().  The precision is 1 micro second.
  *  [:POSIX_TIME_CLOCK_REALTIME] Use time().  The precision is 1 second.
  *
+ *  Emulations for +:CLOCK_MONOTONIC+:
+ *  [:MACH_ABSOLUTE_TIME_CLOCK_MONOTONIC] Use mach_absolute_time(), available on Darwin.
+ * 					  The precision is CPU dependent.
+ *
  *  If the given +clock_id+ is not supported, Errno::EINVAL is raised.
  *
  *  +unit+ specifies a type of the return value.

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]