Module: Metrics::TimeConversion
- Included in:
- Instruments::Meter, Instruments::Timer
- Defined in:
- lib/ruby-metrics/time_units.rb
Constant Summary collapse
- UNITS =
{ :nanoseconds => Nanoseconds, :microseconds => Microseconds, :milliseconds => Milliseconds, :seconds => Seconds, :minutes => Minutes, :hours => Hours }
Instance Method Summary collapse
Instance Method Details
#convert_to_ns(value, unit) ⇒ Object
55 56 57 |
# File 'lib/ruby-metrics/time_units.rb', line 55 def convert_to_ns(value, unit) (UNITS[unit].to_nsec.to_f * value.to_f) end |