MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / timed

Function timed

misc/python/materialize/cli/mz_workload_capture.py:25–32  ·  view source on GitHub ↗
(label: str, *, width: int = 52)

Source from the content-addressed store, hash-verified

23
24@contextmanager
25def timed(label: str, *, width: int = 52):
26 start = time.time()
27 print(f"{label:<{width}} ", file=sys.stderr, end="", flush=True)
28 try:
29 yield
30 finally:
31 dt = time.time() - start
32 print(f" [{dt:7.2f}s]", file=sys.stderr)
33
34
35def to_sql_string(q: bytes | SQL | Composable | LiteralString, conn) -> str:

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected