change/method_profiler

View on GitHub
lib/method_profiler/hirb.rb

Summary

Maintainability
A
0 mins
Test Coverage
require 'hirb'

# All methods in this module can be used as filters in Hirb.
#
module Hirb::Helpers::Table::Filters
  # Converts seconds to milliseconds. Used to format times in
  # the output of {MethodProfiler::Report}.
  #
  # @param [Float] seconds The duration to convert.
  # @return [String] The duration in milliseconds with units displayed. Rounded to 3 decimal places.
  def to_milliseconds(seconds)
    "%.3f ms" % (seconds * 1000)
  end
end