Created
August 9, 2016 19:00
-
-
Save zoffixznet/b8d01cc56b16329857cb5cd1244548f0 to your computer and use it in GitHub Desktop.
This file contains 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
$ cat rub.rb | |
i = 0 | |
for counter in 1..20000000 | |
i = i + counter | |
end | |
$ time ruby rub.rb | |
real 0m3.724s | |
user 0m3.708s | |
sys 0m0.012s | |
$ cat pyth.py | |
i = 0 | |
for j in range(20000000): | |
i = i + j | |
$ time python2.7 pyth.py | |
real 0m2.934s | |
user 0m2.556s | |
sys 0m0.356s | |
$ time python3.2 pyth.py | |
real 0m3.610s | |
user 0m3.580s | |
sys 0m0.024s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment