1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

benchmark.rb: prefer Process::CLOCK_MONOTONIC_RAW

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

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47320 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2014-08-30 06:15:22 +00:00
parent 66d3b9750b
commit 4274b7975e

View file

@ -271,7 +271,10 @@ module Benchmark
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