Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Measure how long require(s) take.
if ENV['DEBUG_REQUIRE']
require 'benchmark'
def require(file)
@@first ||= Time.now
rc = false
ts = Benchmark.measure do
rc = super
end
if ENV['DEBUG_REQUIRE'].to_f < ts.total
total = ts.format("%t require #{file}")
from_start = (Time.now - @@first).to_i
$stdout.puts "#{total} (#{from_start} second(s) from start)"
end
rc
end
end
@dblock
Owner

Add the following to config/boot.rb:

require File.expand_path('../initializers/debug_require', __FILE__)
@DaveCollinsJr

Thanks for this! Very useful!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.