Module: Cutoff::Timer

Included in:
Cutoff
Defined in:
lib/cutoff/timer.rb

Overview

Tracks the current time for cutoff

Instance Method Summary collapse

Instance Method Details

#nowFloat

The current relative time

If it is available, this will use a monotonic clock. This is a clock that always moves forward in time and starts at an arbitrary point (such as system startup time). If that is not available on this system, Time.now will be used.

This does not represent current real time

Returns:

  • (Float)

    The current relative time as a float



17
18
19
# File 'lib/cutoff/timer.rb', line 17

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