6 7 8 9 10 11 12 13
# 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 && Sequent.logger.debug? end