Skip to main content

Module timings

Module timings 

Source
Expand description

Central timing instrumentation for startup profiling.

Port of the upstream packages/coding-agent/src/core/timings.ts. Enable with the RPI_TIMING=1 environment variable; disabled builds pay only a single atomic load per call.

Timings are grouped by namespace (main for the primary startup path, extensions for JS/Rust extension loading) and flushed once at shutdown.

Enums§

TimingNamespace

Functions§

enabled
True when RPI_TIMING=1. Evaluated once.
print_timings
Print every accumulated namespace to stderr. No-op unless RPI_TIMING=1.
reset
Reset a namespace’s timings and mark “now” as its reference point.
time
Record the elapsed time since the previous time/reset in this namespace.