Class: Timmy::MasterTimer
- Inherits:
-
Object
- Object
- Timmy::MasterTimer
- Defined in:
- lib/timmy/master_timer.rb
Class Method Summary collapse
Class Method Details
.get ⇒ Object
9 10 11 12 13 |
# File 'lib/timmy/master_timer.rb', line 9 def get return @frozen_duration if @frozen_duration Time.now.to_f - @start_time end |
.set(frozen_duration) ⇒ Object
15 16 17 |
# File 'lib/timmy/master_timer.rb', line 15 def set(frozen_duration) @frozen_duration = frozen_duration end |
.start(frozen_time = nil) ⇒ Object
4 5 6 7 |
# File 'lib/timmy/master_timer.rb', line 4 def start(frozen_time = nil) @start_time = frozen_time if frozen_time @start_time ||= Time.now.to_f end |