Class: TimerAction

Inherits:
Object show all
Defined in:
lib/extensions/mspec/mspec/runner/actions/timer.rb

Instance Method Summary collapse

Instance Method Details

#elapsedObject



15
16
17
# File 'lib/extensions/mspec/mspec/runner/actions/timer.rb', line 15

def elapsed
  @stop - @start
end

#finishObject



11
12
13
# File 'lib/extensions/mspec/mspec/runner/actions/timer.rb', line 11

def finish
  @stop = Time.now
end

#formatObject



19
20
21
# File 'lib/extensions/mspec/mspec/runner/actions/timer.rb', line 19

def format
  "Finished in %f seconds" % elapsed
end

#registerObject



2
3
4
5
# File 'lib/extensions/mspec/mspec/runner/actions/timer.rb', line 2

def register
  MSpec.register :start, self
  MSpec.register :finish, self
end

#startObject



7
8
9
# File 'lib/extensions/mspec/mspec/runner/actions/timer.rb', line 7

def start
  @start = Time.now
end