Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
require 'benchmark'
n = 5_000_000 do |x|"for loop:") { for i in 1..n; a = "1"; end }"times:") { n.times do ; a = "1"; end }"upto:") { 1.upto(n) do ; a = "1"; end }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment