Module: Rhales::Utils

Included in:
LoggingHelpers
Defined in:
lib/rhales/utils.rb,
lib/rhales/utils/logging_helpers.rb

Defined Under Namespace

Modules: LoggingHelpers

Instance Method Summary collapse

Instance Method Details

#nowTime

Returns Current time in UTC.

Returns:

  • (Time)

    Current time in UTC



8
9
10
# File 'lib/rhales/utils.rb', line 8

def now
  Time.now.utc
end

#now_in_μsInteger Also known as: now_in_microseconds

Returns the current time in microseconds. This is used to measure the duration of Database commands.

Alias: now_in_microseconds

Returns:

  • (Integer)

    The current time in microseconds.



18
19
20
# File 'lib/rhales/utils.rb', line 18

def now_in_μs
  Process.clock_gettime(Process::CLOCK_MONOTONIC, :microsecond)
end