Doel
Record helper timing metadata for named code blocks.
Elements runtime reference / Diagnostics
timeBlockRecord helper timing metadata for named code blocks.
timeBlock(name) / measureTime(name, func, *args, **kwargs)
Record helper timing metadata for named code blocks.
time_blockmeasureTimemeasure_timeUse these fields as the Python call arguments or keyword payload for this helper.
{
"name": "fetch-api",
"style": "with timeBlock(name): ..."
}
| Field | Description |
|---|---|
name | Timing label. |
func | Callable for measureTime. |
args/kwargs | Arguments forwarded to func by measureTime. |
timeBlock is a context manager; measureTime returns the callable result.
def run():
with timeBlock("fetch-api"):
rows = fetch_rows()
total = measureTime("count-rows", lambda: len(rows))
return {"rows": total}