Sha256: 24553aa038ed04a3863aa3147afbe04e8a9a74df4174c7a0bdda33ae35729e74
Contents?: true
Size: 817 Bytes
Versions: 11
Compression:
Stored size: 817 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 if RUBY_VERSION >= '3.2' # @return [Float] current monotonic time in milliseconds def monotonic_now ::Process.clock_gettime(::Process::CLOCK_MONOTONIC, :float_millisecond) end else # @return [Float] current monotonic time in milliseconds def monotonic_now ::Process.clock_gettime(::Process::CLOCK_MONOTONIC) * 1_000 end end # @return [Float] current time in float def float_now ::Process.clock_gettime(::Process::CLOCK_REALTIME) end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems