Class: Mutant::Timer Private
- Inherits:
-
Object
- Object
- Mutant::Timer
- 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
-
#elapsed ⇒ Float
private
Monotonic elapsed time of block execution.
-
#now ⇒ Float
private
The now monotonic time.
Instance Method Details
#elapsed ⇒ Float
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
10 11 12 13 14 |
# File 'lib/mutant/timer.rb', line 10 def elapsed start = now yield now - start end |
#now ⇒ Float
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
19 20 21 |
# File 'lib/mutant/timer.rb', line 19 def now process.clock_gettime(Process::CLOCK_MONOTONIC) end |