From: Paul Date: 2007-07-31T20:45:01+09:00 Subject: Re: Performance diffrence between ifs and case def nop end Benchmark.bmbm(20) do |x| x.report("range"){for i in 0..1000000 do nop end} x.report("times"){1000000.times do nop end} x.report("each"){(0..1000000).each do nop end} end ------------------------------------------------ range 0.657000 0.000000 0.657000 ( 0.656000) times 0.609000 0.000000 0.609000 ( 0.609000) each 0.594000 0.000000 0.594000 ( 0.594000) ----------------------------- total: 1.860000sec user system total real range 0.641000 0.000000 0.641000 ( 0.640000) times 0.594000 0.000000 0.594000 ( 0.594000) each 0.578000 0.000000 0.578000 ( 0.594000)