Class: TimerAction
Instance Method Summary collapse
- #current_time ⇒ Object
- #elapsed ⇒ Object
- #finish ⇒ Object
- #format ⇒ Object
- #register ⇒ Object
- #start ⇒ Object
Instance Method Details
#current_time ⇒ Object
23 24 25 |
# File 'lib/mspec/runner/actions/timer.rb', line 23 def current_time Time.now end |
#elapsed ⇒ Object
15 16 17 |
# File 'lib/mspec/runner/actions/timer.rb', line 15 def elapsed @stop - @start end |
#finish ⇒ Object
11 12 13 |
# File 'lib/mspec/runner/actions/timer.rb', line 11 def finish @stop = current_time end |
#format ⇒ Object
19 20 21 |
# File 'lib/mspec/runner/actions/timer.rb', line 19 def format "Finished in %f seconds" % elapsed end |
#register ⇒ Object
2 3 4 5 |
# File 'lib/mspec/runner/actions/timer.rb', line 2 def register MSpec.register :start, self MSpec.register :finish, self end |
#start ⇒ Object
7 8 9 |
# File 'lib/mspec/runner/actions/timer.rb', line 7 def start @start = current_time end |