summaryrefslogtreecommitdiff
path: root/lib/benchmark.rb
diff options
context:
space:
mode:
authorNithin Bekal <[email protected]>2024-09-26 23:39:21 -0400
committergit <[email protected]>2024-09-27 04:31:47 +0000
commitd7e5133d6d9ae882a5f8e1ae85d75104a1e36ec8 ()
treed66d443ac994a7bec00568ec0c660ebd08bdd69b /lib/benchmark.rb
parent3209bb950b07e80a5c32f68e445718be03eb44f0 (diff)
[ruby/benchmark] Add example for Benchmark.realtime
https://.com/ruby/benchmark/commit/0f278be6c1
-rw-r--r--lib/benchmark.rb3
1 files changed, 3 insertions, 0 deletions
@@ -309,6 +309,9 @@ module Benchmark
# Returns the elapsed real time used to execute the given block.
# The unit of time is seconds.
#
def realtime # :yield:
r0 = Process.clock_gettime(Process::CLOCK_MONOTONIC)
yield