Skip to content

Instantly share code, notes, and snippets.

@chris
Created December 3, 2008 07:32
Show Gist options
  • Select an option

  • Save chris/31459 to your computer and use it in GitHub Desktop.

Select an option

Save chris/31459 to your computer and use it in GitHub Desktop.
Ruby benchmarking example
# Ruby benchmarking example
Benchmark.bm(5) do |timer|
date_range = [1.month.ago.to_date, 6.months.from_now.to_date]
timer.report('old way') do
10.times do
# do the old way of code here
end
end
timer.report('new way') do
10.times do
# do the new way of code here
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment