Module: Mutant::Timer Private
- Defined in:
- lib/mutant/timer.rb
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Class Method Summary collapse
-
.elapsed ⇒ Float
private
Monotonic elapsed time of block execution.
-
.now ⇒ Float
private
The now monotonic time.
Class 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
8 9 10 11 12 |
# File 'lib/mutant/timer.rb', line 8 def self.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
17 18 19 |
# File 'lib/mutant/timer.rb', line 17 def self.now Process.clock_gettime(Process::CLOCK_MONOTONIC) end |