pocketlang/test/benchmark/for/for.rb
Thakee Nathees df93b2c1ec gc bugs fixed
- popping operands from the stack was too early -fixed
- some temproary string objects weren't pushed to the vm's temp root
  -fixed
- and some minor bug fixed
2021-05-23 23:25:04 +05:30

11 lines
171 B
Ruby

start = Time.now
list = []
for i in 0...10000000 do list.append(i) end
sum = 0
for i in list do sum += i end
puts sum
puts "elapsed: " + (Time.now - start).to_s + ' s'