class gpr::ScopedPhaseTimer

Adds the enclosing scope’s wall time to one accumulator. Setup, cache, descriptor, posterior, subset, eigen, kernel, factor, gradient, curvature, energy, and schedule form one partition. A scope subtracts any of those siblings that grew inside it, so the sums do not cover the same seconds twice. The snapshot array is private to the calling thread. OpenMP workers do not construct this timer; they join before the calling thread reads the static accumulators.

#include <gpr/ml/PhaseTimers.h>
 
class ScopedPhaseTimer {
public:
    // construction
 
    ScopedPhaseTimer(double& accumulator, const char* label = nullptr);
    ScopedPhaseTimer(const ScopedPhaseTimer&);
    ~ScopedPhaseTimer();
 
    // methods
 
    ScopedPhaseTimer& operator=(const ScopedPhaseTimer&);
};