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
harbr-2.8.1 vendor/bundle/ruby/3.2.0/gems/listen-3.8.0/lib/listen/monotonic_time.rb
listen-3.9.0 lib/listen/monotonic_time.rb
harbr-0.2.10 vendor/bundle/ruby/3.2.0/gems/listen-3.8.0/lib/listen/monotonic_time.rb
harbr-0.2.9 vendor/bundle/ruby/3.2.0/gems/listen-3.8.0/lib/listen/monotonic_time.rb
harbr-0.2.8 vendor/bundle/ruby/3.2.0/gems/listen-3.8.0/lib/listen/monotonic_time.rb
harbr-0.2.7 vendor/bundle/ruby/3.2.0/gems/listen-3.8.0/lib/listen/monotonic_time.rb
harbr-0.2.6 vendor/bundle/ruby/3.2.0/gems/listen-3.8.0/lib/listen/monotonic_time.rb
harbr-0.2.5 vendor/bundle/ruby/3.2.0/gems/listen-3.8.0/lib/listen/monotonic_time.rb
harbr-0.2.4 vendor/bundle/ruby/3.2.0/gems/listen-3.8.0/lib/listen/monotonic_time.rb
harbr-0.2.3 vendor/bundle/ruby/3.2.0/gems/listen-3.8.0/lib/listen/monotonic_time.rb
harbr-0.2.2 vendor/bundle/ruby/3.2.0/gems/listen-3.8.0/lib/listen/monotonic_time.rb
harbr-0.2.1 vendor/bundle/ruby/3.2.0/gems/listen-3.8.0/lib/listen/monotonic_time.rb
harbr-0.2.0 vendor/bundle/ruby/3.2.0/gems/listen-3.8.0/lib/listen/monotonic_time.rb
harbr-0.1.99 vendor/bundle/ruby/3.2.0/gems/listen-3.8.0/lib/listen/monotonic_time.rb
harbr-0.1.98 vendor/bundle/ruby/3.2.0/gems/listen-3.8.0/lib/listen/monotonic_time.rb
harbr-0.1.97 vendor/bundle/ruby/3.2.0/gems/listen-3.8.0/lib/listen/monotonic_time.rb
harbr-0.1.96 vendor/bundle/ruby/3.2.0/gems/listen-3.8.0/lib/listen/monotonic_time.rb
harbr-0.1.95 vendor/bundle/ruby/3.2.0/gems/listen-3.8.0/lib/listen/monotonic_time.rb
harbr-0.1.94 vendor/bundle/ruby/3.2.0/gems/listen-3.8.0/lib/listen/monotonic_time.rb
harbr-0.1.93 vendor/bundle/ruby/3.2.0/gems/listen-3.8.0/lib/listen/monotonic_time.rb