module Airbrake::MonotonicTime

def time_in_ms

Returns:
  • (Integer) - current monotonic time in milliseconds
def time_in_ms
  time_in_nanoseconds / (10.0**6)
end

def time_in_nanoseconds

def time_in_nanoseconds
  Process.clock_gettime(Process::CLOCK_MONOTONIC, :nanosecond)
end

def time_in_nanoseconds

def time_in_nanoseconds
  java.lang.System.nanoTime
end

def time_in_nanoseconds

def time_in_nanoseconds
  time = Time.now
  (time.to_i * (10**9)) + time.nsec
end

def time_in_s

Returns:
  • (Integer) - current monotonic time in seconds
def time_in_s
  time_in_nanoseconds / (10.0**9)
end