#!/usr/local/bin/ruby if ARGV.empty? $stderr.puts "Usage: profiler 'Person.expensive_method(10)' [times]" exit end # Keep the expensive require out of the profile. puts 'Loading Rails...' require File.dirname(__FILE__) + '/../config/environment' # Default to a single execution. N = (ARGV[1] || 1).to_i # Define a method to profile. eval <