class RuboCop::Cop::Performance::ConcurrentMonotonicTime
Process.clock_gettime(Process::CLOCK_MONOTONIC)
# good
Concurrent.monotonic_time
# bad
@example
can be replaced by ‘Process.clock_gettime(Process::CLOCK_MONOTONIC)`.
Identifies places where `Concurrent.monotonic_time`
def on_send(node)
def on_send(node) return unless concurrent_monotonic_time?(node) optional_unit_parameter = ", #{node.first_argument.source}" if node.first_argument prefer = "Process.clock_gettime(Process::CLOCK_MONOTONIC#{optional_unit_parameter})" message = format(MSG, prefer: prefer, current: node.source) add_offense(node, message: message) do |corrector| corrector.replace(node, prefer) end end