Class: Actor::Statistics::Timer
- Inherits:
-
Object
- Object
- Actor::Statistics::Timer
- Defined in:
- lib/actor/statistics/timer.rb
Instance Attribute Summary collapse
- #clock ⇒ Object
-
#start_time ⇒ Object
Returns the value of attribute start_time.
-
#stop_time ⇒ Object
Returns the value of attribute stop_time.
Instance Method Summary collapse
Instance Attribute Details
#clock ⇒ Object
8 9 10 |
# File 'lib/actor/statistics/timer.rb', line 8 def clock @clock ||= Time end |
#start_time ⇒ Object
Returns the value of attribute start_time.
5 6 7 |
# File 'lib/actor/statistics/timer.rb', line 5 def start_time @start_time end |
#stop_time ⇒ Object
Returns the value of attribute stop_time.
6 7 8 |
# File 'lib/actor/statistics/timer.rb', line 6 def stop_time @stop_time end |
Instance Method Details
#reset ⇒ Object
12 13 14 15 16 17 |
# File 'lib/actor/statistics/timer.rb', line 12 def reset self.stop_time = nil self.start_time = clock.now start_time end |
#stop ⇒ Object
19 20 21 22 23 |
# File 'lib/actor/statistics/timer.rb', line 19 def stop self.stop_time = stop_time = clock.now return start_time, stop_time end |