Module: TickTock
- Defined in:
- lib/tick-tock.rb,
lib/tick-tock/duration.rb,
lib/tick-tock/formatter.rb
Defined Under Namespace
Class Method Summary collapse
Class Method Details
.time(duration = nil) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/tick-tock.rb', line 10 def self.time(duration = nil) start = Time.now yield this_timing = TickTock::Duration.from_times(start, Time.now) duration.nil? ? this_timing : duration + this_timing end |