Class: ActiveSupport::Testing::Performance::Profiler
- Defined in:
- lib/rails/perftest/active_support/testing/performance.rb,
lib/rails/perftest/active_support/testing/performance/ruby.rb,
lib/rails/perftest/active_support/testing/performance/jruby.rb,
lib/rails/perftest/active_support/testing/performance/rubinius.rb
Overview
overridden by each implementation.
Instance Method Summary collapse
-
#initialize(*args) ⇒ Profiler
constructor
A new instance of Profiler.
- #record ⇒ Object
- #run ⇒ Object
- #time_with_block ⇒ Object
Methods inherited from Performer
Constructor Details
#initialize(*args) ⇒ Profiler
Returns a new instance of Profiler.
27 28 29 30 |
# File 'lib/rails/perftest/active_support/testing/performance/ruby.rb', line 27 def initialize(*args) super @supported = @metric.measure_mode rescue false end |
Instance Method Details
#record ⇒ Object
152 |
# File 'lib/rails/perftest/active_support/testing/performance.rb', line 152 def record; end |
#run ⇒ Object
151 |
# File 'lib/rails/perftest/active_support/testing/performance.rb', line 151 def run; end |
#time_with_block ⇒ Object
145 146 147 148 149 |
# File 'lib/rails/perftest/active_support/testing/performance.rb', line 145 def time_with_block before = Time.now yield Time.now - before end |