Class: DevSuite::Performance::Profiler::ExecutionTime
- Inherits:
-
Base
- Object
- Utils::Construct::Component::Base
- Base
- DevSuite::Performance::Profiler::ExecutionTime
- Defined in:
- lib/dev_suite/performance/profiler/execution_time.rb
Instance Attribute Summary collapse
-
#stats ⇒ Object
readonly
Returns the value of attribute stats.
Instance Method Summary collapse
Methods inherited from Utils::Construct::Component::Base
Instance Attribute Details
#stats ⇒ Object (readonly)
Returns the value of attribute stats.
7 8 9 |
# File 'lib/dev_suite/performance/profiler/execution_time.rb', line 7 def stats @stats end |
Instance Method Details
#run(&block) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/dev_suite/performance/profiler/execution_time.rb', line 9 def run(&block) result = nil timing = ::Benchmark.measure { result = yield } @stats = calculate_stats(timing) result end |