Skip to content

Instantly share code, notes, and snippets.

@rpechayr
Created November 30, 2016 08:26
Show Gist options
  • Save rpechayr/0db2a0aff6f8baa199d69dcf3ab7f1a1 to your computer and use it in GitHub Desktop.
Save rpechayr/0db2a0aff6f8baa199d69dcf3ab7f1a1 to your computer and use it in GitHub Desktop.
How fast is a computer to count from 0 to 100
beginning = Time.now
1.upto(100).each do |i|
puts i
end
puts "Elapsed #{Time.now - beginning}"
@rpechayr
Copy link
Author

Runs in 0.4 milliseconds on 3GHz dual-core i17 MacBook Pro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment