Skip to content

Instantly share code, notes, and snippets.

@jdunphy
Created January 14, 2010 21:57
Show Gist options
  • Select an option

  • Save jdunphy/277548 to your computer and use it in GitHub Desktop.

Select an option

Save jdunphy/277548 to your computer and use it in GitHub Desktop.
require 'benchmark'
runs = 10000
runner = "Benchmark.bm do |x|"
ARGV.each do |arg|
runner << "
x.report(\"#{arg.tr('"',"'")}\") do
runs.times do
#{arg}
end
end"
end
runner << "
end"
puts runner
eval runner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment