sentientmonkey/flue

View on GitHub
lib/flue/benchmark.rb

Summary

Maintainability
A
0 mins
Test Coverage
require "benchmark"

module Flue
  module Benchmark
    def benchmark(label)
      result = nil
      ms = ::Benchmark.realtime do
        result = yield
      end
      if logger
        logger.info "#{label} (#{ms})"
      end
      result
    end
  end
end