module Benchmarked

Constants

VERSION

Attributes

notifier[W]

Public Class Methods

benchmark_and_notify(obj, method_name, args) { || ... } click to toggle source
# File lib/benchmarked.rb, line 13
def benchmark_and_notify(obj, method_name, args)
  result = nil

  if @notifier.nil?
    result = yield
  else
    measurement = Benchmark.measure { result = yield }
    @notifier.benchmark_taken(measurement, obj, method_name, args, result)
  end

  result
end
clean_configuration() click to toggle source
# File lib/benchmarked.rb, line 26
def clean_configuration
  @notifier = nil
end
configure() { |self| ... } click to toggle source
# File lib/benchmarked.rb, line 9
def configure
  yield(self)
end