Sha256: a9e43ae8412af79c12c765d6598e1f2464792b87c96e5c43c02f020e4e164442

Contents?: true

Size: 527 Bytes

Versions: 26

Compression:

Stored size: 527 Bytes

Contents

# frozen_string_literal: true

module Karafka
  module Core
    # Namespace for some small utilities used across the ecosystem
    module Helpers
      # Time related methods used across Karafka
      module Time
        # @return [Float] current monotonic time in milliseconds
        def monotonic_now
          ::Process.clock_gettime(::Process::CLOCK_MONOTONIC) * 1_000
        end

        # @return [Float] current time in float
        def float_now
          ::Time.now.utc.to_f
        end
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
karafka-core-2.4.0 lib/karafka/core/helpers/time.rb
karafka-core-2.4.0.rc2 lib/karafka/core/helpers/time.rb
karafka-core-2.4.0.rc1 lib/karafka/core/helpers/time.rb
karafka-core-2.4.0.beta2 lib/karafka/core/helpers/time.rb
karafka-core-2.4.0.beta1 lib/karafka/core/helpers/time.rb
karafka-core-2.4.0.alpha1 lib/karafka/core/helpers/time.rb
karafka-core-2.3.0 lib/karafka/core/helpers/time.rb
karafka-core-2.3.0.rc1 lib/karafka/core/helpers/time.rb
karafka-core-2.3.0.alpha1 lib/karafka/core/helpers/time.rb
karafka-core-2.2.7 lib/karafka/core/helpers/time.rb
karafka-core-2.2.6 lib/karafka/core/helpers/time.rb
karafka-core-2.2.5 lib/karafka/core/helpers/time.rb
karafka-core-2.2.4 lib/karafka/core/helpers/time.rb
karafka-core-2.2.3 lib/karafka/core/helpers/time.rb
karafka-core-2.2.2 lib/karafka/core/helpers/time.rb
karafka-core-2.2.1 lib/karafka/core/helpers/time.rb
karafka-core-2.2.0 lib/karafka/core/helpers/time.rb
karafka-core-2.1.1 lib/karafka/core/helpers/time.rb
karafka-core-2.1.0 lib/karafka/core/helpers/time.rb
karafka-core-2.1.0.beta1 lib/karafka/core/helpers/time.rb