Class: Dilation::Timers::Coarse
- Includes:
- Celluloid
- Defined in:
- lib/dilation/timers/coarse.rb
Overview
A Celluloid based timer that is the default for Dilation::Core
Instance Method Summary collapse
-
#start ⇒ Object
Start this timer, ticking every second.
-
#stop ⇒ Object
Stop this timer.
Methods inherited from Timer
Constructor Details
This class inherits a constructor from Dilation::Timers::Timer
Instance Method Details
#start ⇒ Object
Start this timer, ticking every second
22 23 24 25 |
# File 'lib/dilation/timers/coarse.rb', line 22 def start @timer = every(1) { tick } super end |
#stop ⇒ Object
Stop this timer
16 17 18 19 |
# File 'lib/dilation/timers/coarse.rb', line 16 def stop defined?(@timer) && @timer.cancel super end |