Function withCounts

    • Run fn with counting on from a zero baseline; returns the result and the counts it accrued. Restores the prior gate state (counters left as measured).

      Type Parameters

      • T

      Parameters

      • fn: () => T

      Returns { counts: Counts; result: T }