humanize_duration

tfsnippet.utils.humanize_duration(seconds, short_units=True)

Format specified time duration as human readable text.

Parameters:
  • seconds – Number of seconds of the time duration.
  • short_units (bool) – Whether or not to use short units (“d”, “h”, “m”, “s”) instead of long units (“day”, “hour”, “minute”, “second”)? (default False)
Returns:

The formatted time duration.

Return type:

str