hispecdrp.utils.perf_log

High-resolution wall timing for structured logs.

Call sites use perf_clock() and log_wall_s() without import time in their modules; monotonic clocks live here only.

Functions

log_wall_s(logger, t0, fmt, *fmt_args[, level])

Log fmt with fmt_args plus wall_s=<elapsed>.

perf_clock()

Return a monotonic reference time (seconds); pair with log_wall_s().

wall_seconds(t0)

Elapsed seconds since t0 from perf_clock().

log_wall_s(logger, t0, fmt, *fmt_args, level=20)[source]

Log fmt with fmt_args plus wall_s=<elapsed>.

Example: log_wall_s(logger, t0, "STEP foo bar=%s", 42).

perf_clock()[source]

Return a monotonic reference time (seconds); pair with log_wall_s().

wall_seconds(t0)[source]

Elapsed seconds since t0 from perf_clock().