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

ruby-changes:35248

From: nobu <ko1@a...>
Date: Sun, 31 Aug 2014 15:06:00 +0900 (JST)
Subject: [ruby-changes:35248] nobu:r47330 (trunk): benchmark.rb: Process::CLOCK_MONOTONIC_RAW may be unavailable

nobu	2014-08-31 15:05:43 +0900 (Sun, 31 Aug 2014)

  New Revision: 47330

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

  Log:
    benchmark.rb: Process::CLOCK_MONOTONIC_RAW may be unavailable
    
    * lib/benchmark.rb (BENCHMARK_CLOCK): Process::CLOCK_MONOTONIC_RAW
      is not supported on old linux.

  Modified files:
    trunk/lib/benchmark.rb
Index: lib/benchmark.rb
===================================================================
--- lib/benchmark.rb	(revision 47329)
+++ lib/benchmark.rb	(revision 47330)
@@ -272,7 +272,8 @@ module Benchmark https://github.com/ruby/ruby/blob/trunk/lib/benchmark.rb#L272
 
   # :stopdoc:
   case
-  when defined?(Process::CLOCK_MONOTONIC_RAW)
+  when defined?(Process::CLOCK_MONOTONIC_RAW) and
+      (Process.clock_gettime(Process::CLOCK_MONOTONIC_RAW) rescue false)
     BENCHMARK_CLOCK = Process::CLOCK_MONOTONIC_RAW
   when defined?(Process::CLOCK_MONOTONIC)
     BENCHMARK_CLOCK = Process::CLOCK_MONOTONIC

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

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