vibeqc.PerfScope

class vibeqc.PerfScope(name)[source]

Bases: object

Context manager that times its body and pushes the wall + CPU delta into the currently active PerfTracker. No-op when no tracker is active, so call sites can sprinkle with PerfScope("phase_name"): ... unconditionally — the cost when perf logging is off is one contextvars.ContextVar.get() and one time.perf_counter() call.

Re-entrant: nesting two scopes with the same name accumulates correctly (each scope contributes its own wall/CPU).

Parameters:

name (str)

__init__(name)[source]
Parameters:

name (str)

Return type:

None

Methods

__init__(name)

Attributes

name