Include numeric loop in for benchmark.

This commit is contained in:
Bob Nystrom
2014-01-20 08:43:10 -08:00
parent 83b5968340
commit d40d04f0c5
5 changed files with 14 additions and 12 deletions
+3 -2
View File
@@ -1,6 +1,7 @@
list = Array.new(2000000) {|i| i}
start = Time.now
list = []
1000000.times {|i| list << i}
sum = 0
list.each {|i| sum += i}
puts sum