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

ruby-changes:35238

From: nobu <ko1@a...>
Date: Sat, 30 Aug 2014 15:15:34 +0900 (JST)
Subject: [ruby-changes:35238] nobu:r47320 (trunk): benchmark.rb: prefer Process::CLOCK_MONOTONIC_RAW

nobu	2014-08-30 15:15:22 +0900 (Sat, 30 Aug 2014)

  New Revision: 47320

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

  Log:
    benchmark.rb: prefer Process::CLOCK_MONOTONIC_RAW
    
    * lib/benchmark.rb (BENCHMARK_CLOCK): prefer Process::CLOCK_MONOTONIC_RAW
      if available to more accurate measure.

  Modified files:
    trunk/lib/benchmark.rb
Index: lib/benchmark.rb
===================================================================
--- lib/benchmark.rb	(revision 47319)
+++ lib/benchmark.rb	(revision 47320)
@@ -271,7 +271,10 @@ module Benchmark https://github.com/ruby/ruby/blob/trunk/lib/benchmark.rb#L271
   end
 
   # :stopdoc:
-  if defined?(Process::CLOCK_MONOTONIC)
+  case
+  when defined?(Process::CLOCK_MONOTONIC_RAW)
+    BENCHMARK_CLOCK = Process::CLOCK_MONOTONIC_RAW
+  when defined?(Process::CLOCK_MONOTONIC)
     BENCHMARK_CLOCK = Process::CLOCK_MONOTONIC
   else
     BENCHMARK_CLOCK = Process::CLOCK_REALTIME

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

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