ruby--ruby/benchmark/array_sort_block.rb

3 lines
81 B
Ruby

ary = Array.new(1000) { rand(1000) }
10000.times { ary.sort { |a, b| a <=> b } }