def _FormatTime(t):
  """Formats a duration as a human-readable string.

  Args:
    t: A duration in seconds.

  Returns:
    A formatted duration string.
  """
  if t < 1:
    return '%dms' % round(t * 1000)
  else:
    return '%.2fs' % t
dataset/ETHPy150Open google/closure-linter/closure_linter/gjslint.py/_FormatTime/original