Class: BenchmarkRequires::Runner
- Defined in:
- lib/benchmark_requires/runner.rb
Instance Method Summary collapse
- #benchmark(file_name, &block) ⇒ Object
-
#initialize ⇒ Runner
constructor
A new instance of Runner.
Constructor Details
#initialize ⇒ Runner
Returns a new instance of Runner.
5 6 7 8 |
# File 'lib/benchmark_requires/runner.rb', line 5 def initialize @level = 0 @log_buffer = [] end |
Instance Method Details
#benchmark(file_name, &block) ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/benchmark_requires/runner.rb', line 10 def benchmark(file_name, &block) increment_level! time = Benchmark.realtime do yield end buffer_log MessageBuilder.new(file_name, time).(@level) decrement_level! flush_log_buffer if top_level? end |