Class: Stopwatch
- Inherits:
-
Object
- Object
- Stopwatch
- Defined in:
- lib/kale/stopwatch.rb
Instance Attribute Summary collapse
-
#end_time ⇒ Object
Returns the value of attribute end_time.
-
#start_time ⇒ Object
Returns the value of attribute start_time.
Instance Method Summary collapse
Instance Attribute Details
#end_time ⇒ Object
Returns the value of attribute end_time.
3 4 5 |
# File 'lib/kale/stopwatch.rb', line 3 def end_time @end_time end |
#start_time ⇒ Object
Returns the value of attribute start_time.
3 4 5 |
# File 'lib/kale/stopwatch.rb', line 3 def start_time @start_time end |
Instance Method Details
#elapsed_time ⇒ Object
13 14 15 |
# File 'lib/kale/stopwatch.rb', line 13 def elapsed_time self.end_time - self.start_time end |
#start ⇒ Object
5 6 7 |
# File 'lib/kale/stopwatch.rb', line 5 def start self.start_time = Time.now end |
#stop ⇒ Object
9 10 11 |
# File 'lib/kale/stopwatch.rb', line 9 def stop self.end_time = Time.now end |