Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@wuputah
Created October 19, 2010 10:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save wuputah/634000 to your computer and use it in GitHub Desktop.
Save wuputah/634000 to your computer and use it in GitHub Desktop.
require 'benchmark'
Benchmark.bmbm do |x|
x.report { 1_000_000.times { lambda { } } }
x.report { 1_000_000.times { Array.new } }
end
__END__
Rehearsal ------------------------------------
2.490000 0.740000 3.230000 ( 3.238588)
0.810000 0.080000 0.890000 ( 0.888949)
--------------------------- total: 4.120000sec
user system total real
2.390000 0.740000 3.130000 ( 3.137138)
0.390000 0.000000 0.390000 ( 0.389827)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment