humanize_time
- negmas.helpers.humanize_time(secs: int | float | None, align=False, always_show_all_units=False, show_us=False, show_ms=False, always_show_from='') str | None[source]
Prints time that is given as seconds in human readable form. Useful only for times >=1sec.
- Parameters:
secs – float: number of seconds
align – bool, optional: whether to align outputs so that they all take the same size (not implemented)
always_show_all_units – bool, optional: Whether to always show days, hours, and minutes even when they are zeros. default False
always_show_from – One of d,h,m,s,ms,u (day, hour, minute, second, milli-sec, micro-sec) to always show as well as everything shorter than it (i.e passing ‘m’ shows minutes, seconds, … etc)
show_us – bool, if given microseconds and milliseconds will be shown
show_ms – bool, if given milliseconds will be shown
- Returns:
str: formated string with the humanized form