module Sequent::Util::Timer

Public Instance Methods

time(msg) { || ... } click to toggle source
# File lib/sequent/util/timer.rb, line 6
def time(msg)
  start = Time.now
  yield
ensure
  stop = Time.now
  seconds = stop - start
  Sequent.logger.debug("#{msg} in #{seconds} seconds") if seconds > 1
end