diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-02-02 11:09:24 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-02-02 11:09:24 +0000 |
commit | 6445ddf14a5834c8b824776e61e9436b09c3b936 (patch) | |
tree | cb9692448f0295ded69410a1b0157f9527855500 /lib/benchmark.rb | |
parent | 887485907ed1336761dd384eab81d20d4d3fa302 (diff) | |
download | ruby-6445ddf14a5834c8b824776e61e9436b09c3b936.tar.gz |
* lib/benchmark.rb (Benchmark::realtime): make Benchmark#realtime
a bit faster. a patch from Alexander Dymo <dymo@ukrpost.ua> in
[ruby-core:15337].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/benchmark.rb')
-rw-r--r-- | lib/benchmark.rb | 5 |
1 files changed, 4 insertions, 1 deletions
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 |