evan 2026.1.4
Evan
Loading...
Searching...
No Matches
evan::ScopedTimer Class Reference

RAII timer feeding one PhaseStats. More...

#include <headers/evan/FrameStats.hpp>

Public Member Functions

 ScopedTimer (PhaseStats *phase) noexcept
 Starts measuring into phase.
 
 ~ScopedTimer () noexcept
 Adds the elapsed time to the destination phase.
 
 ScopedTimer (const ScopedTimer &)=delete
 
ScopedTimer & operator= (const ScopedTimer &)=delete
 
 ScopedTimer (ScopedTimer &&)=delete
 
ScopedTimer & operator= (ScopedTimer &&)=delete
 

Detailed Description

RAII timer feeding one PhaseStats.

Constructed through FrameStats::timer(), which hands out a disabled timer (null sink) when statistics are off, so the disabled cost at the call site is a single predictable branch and no clock read.

Definition at line 85 of file FrameStats.hpp.

Constructor & Destructor Documentation

◆ ScopedTimer()

evan::ScopedTimer::ScopedTimer ( PhaseStats *  phase)
inlineexplicitnoexcept

Starts measuring into phase.

Parameters
phaseDestination phase, or nullptr to disable the timer.

Definition at line 93 of file FrameStats.hpp.

◆ ~ScopedTimer()

evan::ScopedTimer::~ScopedTimer ( )
inlinenoexcept

Adds the elapsed time to the destination phase.

Definition at line 102 of file FrameStats.hpp.

Here is the call graph for this function:

The documentation for this class was generated from the following file: