Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
class method
Benchmark.realtime
realtime() { || ... }
lib/benchmark.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.3.0/lib/benchmark.rb, line 311
def realtime # :yield:
r0 = Process.clock_gettime(Process::CLOCK_MONOTONIC)
yield
Process.clock_gettime(Process::CLOCK_MONOTONIC) - r0
end
Returns the elapsed real time used to execute the given block.