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

Function _perfcheck

tools/python-3.11.9-amd64/Lib/pprint.py:643–654  ·  view source on GitHub ↗
(object=None)

Source from the content-addressed store, hash-verified

641
642
643def _perfcheck(object=None):
644 import time
645 if object is None:
646 object = [("string", (1, 2), [3, 4], {5: 6, 7: 8})] * 100000
647 p = PrettyPrinter()
648 t1 = time.perf_counter()
649 p._safe_repr(object, {}, None, 0, True)
650 t2 = time.perf_counter()
651 p.pformat(object)
652 t3 = time.perf_counter()
653 print("_safe_repr:", t2 - t1)
654 print("pformat:", t3 - t2)
655
656def _wrap_bytes_repr(object, width, allowance):
657 current = b''

Callers 1

pprint.pyFile · 0.85

Calls 4

_safe_reprMethod · 0.95
pformatMethod · 0.95
PrettyPrinterClass · 0.85
printFunction · 0.50

Tested by

no test coverage detected