module Console::Clock
def self.formatted_duration(duration)
def self.formatted_duration(duration) if duration < 60.0 return "#{duration.round(2)}s" end duration /= 60.0 if duration < 60.0 return "#{duration.floor}m" end duration /= 60.0 if duration < 24.0 return "#{duration.floor}h" end duration /= 24.0 return "#{duration.floor}d" end
def self.now
def self.now ::Process.clock_gettime(::Process::CLOCK_MONOTONIC) end