Created
February 27, 2013 15:27
-
-
Save knightq/5048731 to your computer and use it in GitHub Desktop.
Benchmarking Ruby
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
# Got from here: http://www.skorks.com/2010/03/timing-ruby-code-it-is-easy-with-benchmark/ | |
require "benchmark" | |
Benchmark.bm(7) do |x| | |
x.report("first:") { (1..10000).each { |i| i } } | |
x.report("second:") { (1..10000).each { |i| i }} | |
x.report("third:") { (1..10000).each { |i| i }} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment