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

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

Defined Under Namespace

Modules: MonotonicTime

Instance Method Summary collapse

Instance Method Details

#durationObject



14
15
16
# File 'lib/cucumber/core/test/timer.rb', line 14

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

#nsecObject



18
19
20
# File 'lib/cucumber/core/test/timer.rb', line 18

def nsec
  time_in_nanoseconds - @start_time
end

#secObject



22
23
24
# File 'lib/cucumber/core/test/timer.rb', line 22

def sec
  nsec / (10**9.0)
end

#startObject



9
10
11
12
# File 'lib/cucumber/core/test/timer.rb', line 9

def start
  @start_time = time_in_nanoseconds
  self
end