Module: Airbrake::MonotonicTime Private

Defined in:
lib/airbrake-ruby/monotonic_time.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

MonotonicTime is a helper for getting monotonic time suitable for performance measurements. It guarantees that the time is strictly linearly increasing (unlike realtime).

Examples:

MonotonicTime.time_in_ms #=> 287138801.144576

See Also:

Since:

  • v4.2.4

Class Method Summary collapse

Class Method Details

.time_in_msInteger

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns current monotonic time in milliseconds.

Returns:

  • (Integer)

    current monotonic time in milliseconds

Since:

  • v4.2.4



15
16
17
# File 'lib/airbrake-ruby/monotonic_time.rb', line 15

def time_in_ms
  time_in_nanoseconds / (10.0**6)
end

.time_in_sInteger

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns current monotonic time in seconds.

Returns:

  • (Integer)

    current monotonic time in seconds

Since:

  • v4.2.4



20
21
22
# File 'lib/airbrake-ruby/monotonic_time.rb', line 20

def time_in_s
  time_in_nanoseconds / (10.0**9)
end