aboutsummaryrefslogtreecommitdiffstats
path: root/lib/benchmark.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-18 21:19:18 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-18 21:19:18 +0000
commit7bbf2f308580f468802cd7d32c94fce1b9f1779e (patch)
tree0a680f59e70a78d60e776d7b763e618fb2fec624 /lib/benchmark.rb
parent34276148c4450faa77bb298cfbe005f7c263f802 (diff)
downloadruby-7bbf2f308580f468802cd7d32c94fce1b9f1779e.tar.gz
* 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
Diffstat (limited to 'lib/benchmark.rb')
-rw-r--r--lib/benchmark.rb24
1 files changed, 12 insertions, 12 deletions
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