Created
April 10, 2012 16:11
-
-
Save remear/2352502 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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