Class: Monotonik::ClockTime
- Inherits:
-
Object
- Object
- Monotonik::ClockTime
- Extended by:
- Forwardable
- Includes:
- Singleton
- Defined in:
- lib/monotonik/clock_time.rb
Overview
Class to get monotonic clock time.
Constant Summary collapse
- DEFAULT_TIME_UNIT =
TimeUnits::FLOAT_SECOND
Class Method Summary collapse
Instance Method Summary collapse
-
#now(unit = DEFAULT_TIME_UNIT) ⇒ Float|Integer
Returns a monotonic clock time returned by POSIX ::clock_gettime() function.
Class Method Details
.now(unit = DEFAULT_TIME_UNIT) ⇒ Object
30 |
# File 'lib/monotonik/clock_time.rb', line 30 def_delegator :instance, :now |
Instance Method Details
#now(unit = DEFAULT_TIME_UNIT) ⇒ Float|Integer
Returns a monotonic clock time returned by POSIX ::clock_gettime() function.
40 41 42 |
# File 'lib/monotonik/clock_time.rb', line 40 def now(unit = DEFAULT_TIME_UNIT) Process.clock_gettime(Process::CLOCK_MONOTONIC, unit) end |