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:
parent
66d3b9750b
commit
4274b7975e
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue