Sha256: ddff4edad23b95eacb711d6046688fbbc7ee68bdb5a868af526c3a0ce64765c1

Contents?: true

Size: 454 Bytes

Versions: 91

Compression:

Stored size: 454 Bytes

Contents

# frozen_string_literal: true

module Listen
  module MonotonicTime
    class << self
      if defined?(Process::CLOCK_MONOTONIC)

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

      elsif defined?(Process::CLOCK_MONOTONIC_RAW)

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

      else

        def now
          Time.now.to_f
        end

      end
    end
  end
end

Version data entries

91 entries across 91 versions & 6 rubygems

Version Path
op_connect-0.1.2 vendor/bundle/ruby/3.1.0/gems/listen-3.7.1/lib/listen/monotonic_time.rb
listen-3.7.1 lib/listen/monotonic_time.rb
vagrant-unbundled-2.2.19.0 vendor/bundle/ruby/3.0.0/gems/listen-3.7.0/lib/listen/monotonic_time.rb
vagrant-unbundled-2.2.18.0 vendor/bundle/ruby/3.0.0/gems/listen-3.7.0/lib/listen/monotonic_time.rb
listen-3.7.0 lib/listen/monotonic_time.rb
listen-3.6.0 lib/listen/monotonic_time.rb
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/3.0.0/gems/listen-3.5.1/lib/listen/monotonic_time.rb
listen-3.5.1 lib/listen/monotonic_time.rb
listen-3.5.0 lib/listen/monotonic_time.rb
listen-3.4.1 lib/listen/monotonic_time.rb
listen-3.4.0 lib/listen/monotonic_time.rb