class Monotonik::ClockTime
Class to get monotonic clock time.
Constants
- DEFAULT_TIME_UNIT
Public Instance Methods
now(unit = DEFAULT_TIME_UNIT)
click to toggle source
Returns a monotonic clock time returned by POSIX ::clock_gettime() function.
@param unit [Symbol] Specifies a type of the return value, can be any value from `Monotonik::TimeUnits::ALL`.
@raise [ArgumentError] When unexpected 'unit' value is given.
@return [Float|Integer] A monotonic clock time returned by POSIX ::clock_gettime() function.
# File lib/monotonik/clock_time.rb, line 40 def now(unit = DEFAULT_TIME_UNIT) Process.clock_gettime(Process::CLOCK_MONOTONIC, unit) end