MCPcopy
hub / github.com/Textualize/rich / timer

Function timer

rich/_timer.py:13–19  ·  view source on GitHub ↗

print the elapsed time. (only used in debugging)

(subject: str = "time")

Source from the content-addressed store, hash-verified

11
12@contextlib.contextmanager
13def timer(subject: str = "time") -> Generator[None, None, None]:
14 """print the elapsed time. (only used in debugging)"""
15 start = time()
16 yield
17 elapsed = time() - start
18 elapsed_ms = elapsed * 1000
19 print(f"{subject} elapsed {elapsed_ms:.1f}ms")

Callers 2

table.pyFile · 0.90

Calls 1

printFunction · 0.70

Tested by

no test coverage detected