aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-11 08:09:07 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-11 08:09:07 +0000
commitb8eec6b6915e87f341bbb7166eda72694f47f12d (patch)
tree82f6607f688120845e3650c9fe11f95b794f83af
parentdd9a92417d0e7d9fd3545feda6240140de50fac8 (diff)
downloadruby-b8eec6b6915e87f341bbb7166eda72694f47f12d.tar.gz
lib/benchmark.rb: remove CLOCK_MONOTONIC_RAW support
In addition to being unaffected by _offset_ correction, CLOCK_MONOTONIC_RAW is also unaffected by _frequency_ correction, making it unsuitable for measuring real time on systems where the clock is always running too fast or slow. CLOCK_MONOTONIC (without _RAW) is the correct clock, as it is unaffected by _offset_ correction (due to human error or battery replacement), but still takes _frequency_ correction into account for clocks which consistently run too fast or slow. Thanks to Vít Ondruch for reporting the issue on ARM [Bug #10202] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--lib/benchmark.rb3
2 files changed, 6 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index f7d266cdff..9f3512c6f6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Thu Sep 11 17:04:54 2014 Eric Wong <e@80x24.org>
+
+ * lib/benchmark.rb: remove CLOCK_MONOTONIC_RAW support
+ Thanks to Vít Ondruch for reporting the issue on ARM.
+ [Bug #10202]
+
Thu Sep 11 14:31:57 2014 Koichi Sasada <ko1@atdot.net>
* include/ruby/ruby.h: freeze nil/true/false.
diff --git a/lib/benchmark.rb b/lib/benchmark.rb
index 1b08e7d2b3..690dff1c28 100644
--- a/lib/benchmark.rb
+++ b/lib/benchmark.rb
@@ -272,9 +272,6 @@ module Benchmark
# :stopdoc:
case
- 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
else