Skip to content

Instantly share code, notes, and snippets.

@nathmisaki
Created April 18, 2013 23:31
Show Gist options
  • Select an option

  • Save nathmisaki/5417013 to your computer and use it in GitHub Desktop.

Select an option

Save nathmisaki/5417013 to your computer and use it in GitHub Desktop.
require 'benchmark'
require 'logger'
log = Logger.new(STDOUT)
log.level = Logger::DEBUG
n = ARGV[0].to_i
Benchmark.bm do |b|
b.report "info level" do
log.level = Logger::INFO
n.times { a=1+1; log.debug(a) }
end
b.report "no log" do
n.times { a=1+1 }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment