Skip to content

Instantly share code, notes, and snippets.

@enebo
Created July 6, 2012 19:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save enebo/3062211 to your computer and use it in GitHub Desktop.
Save enebo/3062211 to your computer and use it in GitHub Desktop.
Perfer.session "Array#sort" do |s|
s.bench "Array#sort" do |n, b|
b.description "Yeah sorting"
ary = Array.new(n) { rand(n) }
b.measure do
ary.sort
end
end
s.bench "Array#sort!" do |n|
ary = Array.new(n) { rand(n) }
s.measure do
ary.sort!
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment