MCPcopy
hub / github.com/vasusen-code/SaveRestrictedContentBot / TimeFormatter

Function TimeFormatter

main/plugins/progress.py:79–88  ·  view source on GitHub ↗
(milliseconds: int)

Source from the content-addressed store, hash-verified

77
78
79def TimeFormatter(milliseconds: int) -> str:
80 seconds, milliseconds = divmod(int(milliseconds), 1000)
81 minutes, seconds = divmod(seconds, 60)
82 hours, minutes = divmod(minutes, 60)
83 days, hours = divmod(hours, 24)
84 tmp = ((str(days) + "d, ") if days else "") + \
85 ((str(hours) + "h, ") if hours else "") + \
86 ((str(minutes) + "m, ") if minutes else "") + \
87 ((str(seconds) + "s, ") if seconds else "")
88 return tmp[:-2]

Callers 1

progress_for_pyrogramFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected