Skip to main content

Module ftime

Module ftime 

Source
Expand description

ftime submodule — TEMPORARY per-function timing scaffold (Rust-only). TEMPORARY measurement scaffold — per-shell-function inclusive timing.

zsh/zprof cannot be used to profile zshrs: zprof_wrapper is ported but never registered (boot_ returns 0 where C returns addwrapper(m, wrapper), zprof.c:362) and there is no funcwrap infrastructure to register it with. This stands in until that is built.

Gated on ZSHRS_LOG containing ftime; when the gate is off every entry point is a single relaxed atomic load and returns None.

Times are INCLUSIVE (like zprof’s time column, not self): a nested call is counted in its own row and in every ancestor’s.

Functions§

dump_and_reset
Write the aggregate to /tmp/ftime.log, highest total first, and reset. Called at the end of a completion so one TAB yields one report.
start
Begin timing name; None when the gate is off.
stop
Accumulate the elapsed time for a span opened by start.