OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmm::perf::ScopedTimer Struct Reference

#include <PerfTimers.hpp>

Collaboration diagram for openswmm::perf::ScopedTimer:

Public Member Functions

 ScopedTimer (double &a) noexcept
 Start an unconditional wall timer against a borrowed accumulator.
 
 ~ScopedTimer () noexcept
 Add complete elapsed wall seconds to the borrowed accumulator.
 
 ScopedTimer (const ScopedTimer &)=delete
 Prevent copying an active ScopedTimer scope.
 
ScopedTimer & operator= (const ScopedTimer &)=delete
 Prevent replacing an active ScopedTimer scope by copy assignment.
 

Public Attributes

double * acc
 
std::chrono::steady_clock::time_point t0
 

Constructor & Destructor Documentation

◆ ScopedTimer() [1/2]

openswmm::perf::ScopedTimer::ScopedTimer ( double & a)
inlineexplicitnoexcept

Start an unconditional wall timer against a borrowed accumulator.

Reads the clock even when profiling is disabled. Nested ScopedTimers include child time, unlike GatedTimer. Do not copy; destruction must occur before a is destroyed.

Parameters
[in,out]aCaller-owned seconds accumulator that must outlive this timer; updates are not synchronized.
Here is the caller graph for this function:

◆ ~ScopedTimer()

openswmm::perf::ScopedTimer::~ScopedTimer ( )
inlinenoexcept

Add complete elapsed wall seconds to the borrowed accumulator.

No environment check and no locking; nested timer intervals can overlap.

◆ ScopedTimer() [2/2]

openswmm::perf::ScopedTimer::ScopedTimer ( const ScopedTimer & )
delete

Prevent copying an active ScopedTimer scope.

A copied scope would duplicate ownership of timing/counter cleanup and is forbidden at compile time.

Here is the call graph for this function:

Member Function Documentation

◆ operator=()

ScopedTimer & openswmm::perf::ScopedTimer::operator= ( const ScopedTimer & )
delete

Prevent replacing an active ScopedTimer scope by copy assignment.

Scope state must be completed by its original object on the thread that created it.

Here is the call graph for this function:

Member Data Documentation

◆ acc

double* openswmm::perf::ScopedTimer::acc

◆ t0

std::chrono::steady_clock::time_point openswmm::perf::ScopedTimer::t0

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