ruby--ruby/benchmark/hash_keys.rb

10 lines
72 B
Ruby

h = {}
10000.times do |i|
h[i] = nil
end
5000.times do
h.keys
end