MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / format_time

Function format_time

tools/python-3.11.9-amd64/Lib/timeit.py:345–357  ·  view source on GitHub ↗
(dt)

Source from the content-addressed store, hash-verified

343 return 1
344
345 def format_time(dt):
346 unit = time_unit
347
348 if unit is not None:
349 scale = units[unit]
350 else:
351 scales = [(scale, unit) for unit, scale in units.items()]
352 scales.sort(reverse=True)
353 for scale, unit in scales:
354 if dt >= scale:
355 break
356
357 return "%.*g %s" % (precision, dt / scale, unit)
358
359 if verbose:
360 print("raw times: %s" % ", ".join(map(format_time, raw_timings)))

Callers 1

mainFunction · 0.85

Calls 2

itemsMethod · 0.45
sortMethod · 0.45

Tested by

no test coverage detected