Module: Eclair::BenchmarkHelper
- Defined in:
- lib/eclair/helpers/benchmark_helper.rb
Instance Method Summary collapse
Instance Method Details
#benchmark(name, &blk) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/eclair/helpers/benchmark_helper.rb', line 5 def benchmark(name, &blk) result = nil if ENV['BM'] bm = Benchmark.measure do result = blk.call end STDERR.puts "Elasped Time for #{name}:" STDERR.puts bm result else blk.call end end |