MCPcopy
hub / github.com/twitter/communitynotes / time_block

Function time_block

scoring/src/scoring/constants.py:1183–1189  ·  view source on GitHub ↗
(label)

Source from the content-addressed store, hash-verified

1181
1182@contextmanager
1183def time_block(label):
1184 start = time.time()
1185 try:
1186 yield
1187 finally:
1188 end = time.time()
1189 logger.info(f"{label} elapsed time: {end - start:.2f} secs ({((end - start) / 60.0):.2f} mins)")
1190
1191
1192### TODO: weave through second round intercept.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected