Module: Hirb::Helpers::Table::Filters

Defined in:
lib/method_profiler/hirb.rb

Overview

All methods in this module can be used as filters in Hirb.

Instance Method Summary collapse

Instance Method Details

#to_milliseconds(seconds) ⇒ String

Converts seconds to milliseconds. Used to format times in the output of MethodProfiler::Report.

Parameters:

  • seconds (Float)

    The duration to convert.

Returns:

  • (String)

    The duration in milliseconds with units displayed. Rounded to 3 decimal places.



11
12
13
# File 'lib/method_profiler/hirb.rb', line 11

def to_milliseconds(seconds)
  "%.3f ms" % (seconds * 1000)
end