protected Method

Benchmarking.render_with_benchmark(options = nil, deprecated_status = nil, &block)

There's no documentation for this item.

Source Code

# File action_controller/benchmarking.rb, line 44
def render_with_benchmark(options = nil, deprecated_status = nil, &block)
  unless logger
    render_without_benchmark(options, &block)
  else
    db_runtime = ActiveRecord::Base.connection.reset_runtime if Object.const_defined?("ActiveRecord") && ActiveRecord::Base.connected?

    render_output = nil
    @rendering_runtime = Benchmark::measure{ render_output = render_without_benchmark(options, &block) }.real

    if Object.const_defined?("ActiveRecord") && ActiveRecord::Base.connected?
      @db_rt_before_render = db_runtime
      @db_rt_after_render = ActiveRecord::Base.connection.reset_runtime
      @rendering_runtime -= @db_rt_after_render
    end

    render_output
  end
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.