Sha256: 9a76e8f58583edb1f23ab3577159e10c73679478cc8e5e26ff40e9c7e07a5210

Contents?: true

Size: 311 Bytes

Versions: 4

Compression:

Stored size: 311 Bytes

Contents

module Salus
  # Monotonic time if possible
  class MonotonicTime
    # Get monotonic time
    if defined?(Process::CLOCK_MONOTONIC)
      def self.get
        Process.clock_gettime(Process::CLOCK_MONOTONIC)
      end
    else
      def self.get
        Time.now.to_f
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
salus-0.2.1 lib/salus/thread/monotonictime.rb
salus-0.2.0 lib/salus/thread/monotonictime.rb
salus-0.1.3 lib/salus/thread/monotonictime.rb
salus-0.1.2 lib/salus/thread/monotonictime.rb