From 7bbf2f308580f468802cd7d32c94fce1b9f1779e Mon Sep 17 00:00:00 2001 From: drbrain Date: Wed, 18 May 2011 21:19:18 +0000 Subject: * lib: Convert tabs to spaces for ruby files per http://redmine.ruby-lang.org/projects/ruby/wiki/DeveloperHowto#coding-style Patch by Steve Klabnik [Ruby 1.9 - Bug #4730] Patch by Jason Dew [Ruby 1.9 - Feature #4718] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/benchmark.rb | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'lib/benchmark.rb') diff --git a/lib/benchmark.rb b/lib/benchmark.rb index 84ed6c77f9..0c786a4862 100644 --- a/lib/benchmark.rb +++ b/lib/benchmark.rb @@ -254,9 +254,9 @@ module Benchmark puts 'Rehearsal '.ljust(width+CAPTION.length,'-') ets = job.list.inject(Tms.new) { |sum,(label,item)| print label.ljust(width) - res = Benchmark.measure(&item) - print res.format - sum + res + res = Benchmark.measure(&item) + print res.format + sum + res }.format("total: %tsec") print " #{ets}\n\n".rjust(width+CAPTION.length+2,'-') @@ -520,14 +520,14 @@ module Benchmark cutime.__send__(op, x.cutime), cstime.__send__(op, x.cstime), real.__send__(op, x.real) - ) + ) else Benchmark::Tms.new(utime.__send__(op, x), stime.__send__(op, x), cutime.__send__(op, x), cstime.__send__(op, x), real.__send__(op, x) - ) + ) end end end @@ -548,13 +548,13 @@ if __FILE__ == $0 x.report("for:") {for _ in 1..n; _ = "1"; end} # Benchmark.measure x.report("times:") {n.times do ; _ = "1"; end} x.report("upto:") {1.upto(n) do ; _ = "1"; end} - end +end - benchmark do - [ - measure{for _ in 1..n; _ = "1"; end}, # Benchmark.measure - measure{n.times do ; _ = "1"; end}, - measure{1.upto(n) do ; _ = "1"; end} - ] +benchmark do + [ + measure{for _ in 1..n; _ = "1"; end}, # Benchmark.measure + measure{n.times do ; _ = "1"; end}, + measure{1.upto(n) do ; _ = "1"; end} + ] end end -- cgit v1.2.3