Return to Snippet

Revision: 6186
at May 5, 2008 23:03 by crazylion


Initial Code
require 'benchmark' n = 50000 Benchmark.bm do |x| x.report { for i in 1..n; a = "1"; end } x.report { n.times do ; a = "1"; end } x.report { 1.upto(n) do ; a = "1"; end } end

Initial URL
http://www.ruby-doc.org/core/classes/Benchmark.html

Initial Description

                                

Initial Title
Module: Benchmark

Initial Tags
ruby

Initial Language
Ruby