Created
November 30, 2016 08:26
-
-
Save rpechayr/0db2a0aff6f8baa199d69dcf3ab7f1a1 to your computer and use it in GitHub Desktop.
How fast is a computer to count from 0 to 100
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
beginning = Time.now | |
1.upto(100).each do |i| | |
puts i | |
end | |
puts "Elapsed #{Time.now - beginning}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Runs in 0.4 milliseconds on 3GHz dual-core i17 MacBook Pro