diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | lib/benchmark.rb | 5 |
2 files changed, 10 insertions, 1 deletions
@@ -1,3 +1,9 @@ +Sat Feb 2 20:06:42 2008 Yukihiro Matsumoto <matz@ruby-lang.org> + + * lib/benchmark.rb (Benchmark::realtime): make Benchmark#realtime + a bit faster. a patch from Alexander Dymo <dymo@ukrpost.ua> in + [ruby-core:15337]. + Sat Feb 2 09:53:39 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> * configure.in (darwin): disabled fat-binary support which confuses diff --git a/lib/benchmark.rb b/lib/benchmark.rb index c7c3935131..577d07acbc 100644 --- a/lib/benchmark.rb +++ b/lib/benchmark.rb @@ -304,7 +304,10 @@ module Benchmark # Returns the elapsed real time used to execute the given block. # def realtime(&blk) # :yield: - Benchmark::measure(&blk).real + r0 = Time.now + yield + r1 = Time.now + r1.to_f - r0.to_f end |