Files
RubyMotion/test/Benchmark/app/benchmark/hash/aref.rb
2013-11-16 15:35:50 +09:00

17 lines
259 B
Ruby

def hash_aset(x)
x.report "hash[key]= with exist key" do
h = $small_hash.dup
1000000.times do |i|
h[:SlBkyplxcZ] = i
end
end
x.report "hash[key]= with new hash" do
h = {}
1000000.times do |i|
h[i] = i
end
end
end