Class: ElasticGraph::Support::MonotonicClock

Inherits:
Object
  • Object
show all
Defined in:
lib/elastic_graph/support/monotonic_clock.rb

Overview

A simple abstraction that provides a monotonic clock.

Instance Method Summary collapse

Instance Method Details

#now_in_msObject

Returns an abstract “now” value in integer milliseconds, suitable for calculating a duration or deadline, without being impacted by leap seconds, etc.



15
16
17
# File 'lib/elastic_graph/support/monotonic_clock.rb', line 15

def now_in_ms
  ::Process.clock_gettime(::Process::CLOCK_MONOTONIC, :millisecond)
end