Class: Mutant::Timer Private

Inherits:
Object
  • Object
show all
Defined in:
lib/mutant/timer.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Defined Under Namespace

Classes: Deadline

Instance Method Summary collapse

Instance Method Details

#elapsedFloat

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Monotonic elapsed time of block execution

Returns:

  • (Float)


10
11
12
13
14
# File 'lib/mutant/timer.rb', line 10

def elapsed
  start = now
  yield
  now - start
end

#nowFloat

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

The now monotonic time

Returns:

  • (Float)


19
20
21
# File 'lib/mutant/timer.rb', line 19

def now
  process.clock_gettime(Process::CLOCK_MONOTONIC)
end