1
0
forked from Mirror/wren
Files
wren/test/benchmark/map_numeric.rb
Bob Nystrom 64eccdd9be Reorganize tests and benchmark scripts.
Mainly to get rid of one top level directory. But this will
also be useful when there are tests of the embedding API.
2015-03-14 12:45:56 -07:00

20 lines
225 B
Ruby

start = Time.now
map = Hash.new
for i in (1..1000000)
map[i] = i
end
sum = 0
for i in (1..1000000)
sum = sum + map[i]
end
puts sum
for i in (1..1000000)
map.delete(i)
end
puts "elapsed: " + (Time.now - start).to_s