Module: Karafka::Core::Helpers::Time
- Included in:
- Monitoring::Notifications, Monitoring::StatisticsDecorator
- Defined in:
- lib/karafka/core/helpers/time.rb
Overview
Time related methods used across Karafka
Instance Method Summary collapse
-
#float_now ⇒ Float
Current time in float.
-
#monotonic_now ⇒ Float
Current monotonic time in milliseconds.
Instance Method Details
#float_now ⇒ Float
Returns current time in float.
15 16 17 |
# File 'lib/karafka/core/helpers/time.rb', line 15 def float_now ::Time.now.utc.to_f end |
#monotonic_now ⇒ Float
Returns current monotonic time in milliseconds.
10 11 12 |
# File 'lib/karafka/core/helpers/time.rb', line 10 def monotonic_now ::Process.clock_gettime(::Process::CLOCK_MONOTONIC) * 1_000 end |