Module: Cutoff::Timer

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

Instance Method Summary collapse

Instance Method Details

#nowFloat

The current time

If it is available, this will use a monotonic clock. This is a clock that always moves forward in time. If that is not available on this system, Time.now will be used

Returns:

  • (Float)

    The current time as a float



13
14
15
# File 'lib/cutoff/timer.rb', line 13

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