Sha256: 9b16fbf061c171059fba75a3d4227871765a072ef5ee8bd410b5ab661480524e

Contents?: true

Size: 352 Bytes

Versions: 1

Compression:

Stored size: 352 Bytes

Contents

require 'benchmark'

module Nitro
  
module BenchmarkHelper

  # Log real time spent on a task. Example:
  #  benchmark "Doing an operation" { operation }
  
  def benchmark(message = 'Benchmarking')
    real = Benchmark.realtime { yield }
    Logger.info "#{message}: time = #{'%.5f' % real} ms."
  end

end

end

# * George Moschovitis <gm@navel.gr>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nitro-0.26.0 lib/nitro/helper/benchmark.rb