Module: Vedeu::Logging::ClockTime
- Defined in:
- lib/vedeu/logging/clock_time.rb
Overview
If the system supports Process::CLOCK_MONOTONIC use that for timestamps.
Vedeu.clock_time # => 15217.232113 (Process::CLOCK_MONOTONIC)
# => 1447196800.3098037 (Time.now)
Class Method Summary collapse
Class Method Details
.clock_time ⇒ Float|Time
14 15 16 17 18 19 20 21 22 |
# File 'lib/vedeu/logging/clock_time.rb', line 14 def self.clock_time if defined?(Process::CLOCK_MONOTONIC) Process.clock_gettime(Process::CLOCK_MONOTONIC) else Time.now end end |