Class: Cucumber::Core::Test::Timer

Inherits:
Object
  • Object
show all
Defined in:
lib/cucumber/core/test/timer.rb

Instance Method Summary collapse

Instance Method Details

#durationObject



12
13
14
# File 'lib/cucumber/core/test/timer.rb', line 12

def duration
  Result::Duration.new(nsec)
end

#nsecObject



16
17
18
# File 'lib/cucumber/core/test/timer.rb', line 16

def nsec
  time_in_nanoseconds - @start_time
end

#secObject



20
21
22
# File 'lib/cucumber/core/test/timer.rb', line 20

def sec
  nsec / 10 ** 9.0
end

#startObject



7
8
9
10
# File 'lib/cucumber/core/test/timer.rb', line 7

def start
  @start_time = time_in_nanoseconds
  self
end