Module: Sequent::Util::Timer

Included in:
Migrations::ViewSchema
Defined in:
lib/sequent/util/timer.rb

Instance Method Summary collapse

Instance Method Details

#time(msg) ⇒ Object



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
end