MCPcopy Create free account
hub / github.com/pytorch/pytorch / convert_time

Function convert_time

tools/code_coverage/package/util/utils.py:17–25  ·  view source on GitHub ↗
(seconds: float)

Source from the content-addressed store, hash-verified

15
16
17def convert_time(seconds: float) -> str:
18 seconds = int(round(seconds))
19 seconds = seconds % (24 * 3600)
20 hour = seconds // 3600
21 seconds %= 3600
22 minutes = seconds // 60
23 seconds %= 60
24
25 return "%d:%02d:%02d" % (hour, minutes, seconds)
26
27
28def print_time(message: str, start_time: float, summary_time: bool = False) -> None:

Callers 1

print_timeFunction · 0.85

Calls 1

roundFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…