inpystem.tools.sec2str module

This small module only contain sec2str, which is a function to display time in human-readable format.

inpystem.tools.sec2str.sec2str(t)

Returns a human-readable time str from a duration in s.

Parameters

t (float) – Duration in seconds.

Returns

Human-readable time str.

Return type

str

Example

>>> from inpystem.tools.sec2str import sec2str
>>> sec2str(5.2056)
5.21s
>>> sec2str(3905)
'1h 5m 5s'