module Metrics::TimeConversion

Constants

UNITS

Public Instance Methods

convert_to_ns(value, unit) click to toggle source
# File lib/ruby-metrics/time_units.rb, line 49
def convert_to_ns(value, unit)
  UNITS[unit].to_nsec.to_f * value.to_f
end
scale_time_units(source, dest) click to toggle source
# File lib/ruby-metrics/time_units.rb, line 53
def scale_time_units(source, dest)
  UNITS[source].to_nsec.to_f / UNITS[dest].to_nsec.to_f
end