blob: aca84055c24da18c9973574c7b1420ff06f1a040 (
plain) (
tree)
|
|
#!/usr/local/bin/ruby
if ARGV.empty?
puts "Usage: profiler 'Person.expensive_method(10)' [times]"
exit
end
require File.dirname(__FILE__) + '/../config/environment'
require "profiler"
Profiler__::start_profile
(ARGV[1] || 1).to_i.times { eval(ARGV.first) }
Profiler__::stop_profile
Profiler__::print_profile($stdout)
|