Skip to content

Instantly share code, notes, and snippets.

@oropon
Created January 28, 2014 06:22
Show Gist options
  • Save oropon/8663077 to your computer and use it in GitHub Desktop.
Save oropon/8663077 to your computer and use it in GitHub Desktop.
require 'benchmark'
ary = []
itrts = 50_000_000
code_range = 1e+13.to_i...4e+13.to_i
itrts.times do |i|
ary << rand(code_range)
end
puts Benchmark::CAPTION
puts Benchmark.measure{
10.times do ary.uniq end
}
#$ ruby uniq.rb
# user system total real
#524.510000 15.080000 539.590000 (539.669947)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment