# File lib/cabin/metrics/timer.rb, line 11 def time(&block) return time_block(&block) if block_given? # Return an object we can .stop # Call record(...) when we stop. return TimerContext.new { |duration| record(duration) } end