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
49 50 51 |
# 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 |