Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions harness/harness.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,10 @@

puts RUBY_DESCRIPTION

if defined?(Process.clock_gettime) && defined?(Process::CLOCK_MONOTONIC)
def realtime
r0 = Process.clock_gettime(Process::CLOCK_MONOTONIC)
yield
Process.clock_gettime(Process::CLOCK_MONOTONIC) - r0
end
else
require "benchmark"

def realtime(&block)
Benchmark.realtime(&block)
end
def realtime
r0 = Process.clock_gettime(Process::CLOCK_MONOTONIC)
yield
Process.clock_gettime(Process::CLOCK_MONOTONIC) - r0
end

# Takes a block as input
Expand Down