Skip to content

Instantly share code, notes, and snippets.

@remear
Created April 10, 2012 16:11
Show Gist options
  • Save remear/2352502 to your computer and use it in GitHub Desktop.
Save remear/2352502 to your computer and use it in GitHub Desktop.
$ time ruby -e "100000000.times { [-2, 0, 33, 304, 2, -2].max }"
real 1m43.896s
user 1m43.859s
sys 0m0.031s
$ time ruby -e "100000000.times { [-2, 0, 33, 304, 2, -2].sort.last }"
real 1m33.644s
user 1m33.612s
sys 0m0.027s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment