Skip to content

Instantly share code, notes, and snippets.

@padde
Created November 28, 2011 11:32
Show Gist options
  • Select an option

  • Save padde/1400077 to your computer and use it in GitHub Desktop.

Select an option

Save padde/1400077 to your computer and use it in GitHub Desktop.
Quick benchmarking in Ruby
def quick_benchmark(repetitions=100, &block)
require 'benchmark'
Benchmark.bmbm do |b|
b.report {repetitions.times &block}
end
nil
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment