def format_time( time, expected = 30 )
      timef = time.uncolorize.to_f
      case
      when timef > expected * 2 then time.to_s.uncolorize.red
      when timef > expected     then time.to_s.uncolorize.yellow
      else time
      end
    end
def format_time( time, expected = 30 )
      timef = time.uncolorize.to_f
      case
      when timef > expected * 2 then time.to_s.uncolorize.red
      when timef > expected     then time.to_s.uncolorize.yellow
      else time
      end
    end
Formats a time value expressed in ms, adding color to highlight times
 outside the expected range.

 If `time` is more than `expected` it's highlighted yellow. If it's more
 than double it's highlighted red.

 @param [String] time in ms.
 @param [Float] expected maximum amount of time it should have taken.
 @return [String] the formatted time.