Skip to content

Instantly share code, notes, and snippets.

@zoffixznet
Created August 9, 2016 19:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoffixznet/b8d01cc56b16329857cb5cd1244548f0 to your computer and use it in GitHub Desktop.
Save zoffixznet/b8d01cc56b16329857cb5cd1244548f0 to your computer and use it in GitHub Desktop.
$ 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