Audacity 3.2.0
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
FrameStatistics::Stopwatch Class Referencefinal

RAII wrapper used to measure a section time. More...

#include <FrameStatistics.h>

Public Member Functions

 ~Stopwatch () noexcept
 

Private Member Functions

 Stopwatch (SectionID section) noexcept
 

Private Attributes

SectionID mSection
 
Timepoint mStart
 

Friends

class FrameStatistics
 

Detailed Description

RAII wrapper used to measure a section time.

Definition at line 56 of file FrameStatistics.h.

Constructor & Destructor Documentation

◆ ~Stopwatch()

FrameStatistics::Stopwatch::~Stopwatch ( )
noexcept

Definition at line 26 of file FrameStatistics.cpp.

27{
28 GetInstance().AddEvent(mSection, FrameStatistics::Clock::now() - mStart);
29}
void AddEvent(SectionID section, Duration duration)
FrameStatistics & GetInstance() noexcept

References FrameStatistics::AddEvent(), anonymous_namespace{FrameStatistics.cpp}::GetInstance(), mSection, and mStart.

Here is the call graph for this function:

◆ Stopwatch()

FrameStatistics::Stopwatch::Stopwatch ( SectionID  section)
explicitprivatenoexcept

Definition at line 31 of file FrameStatistics.cpp.

32 : mSection(section)
33 , mStart(FrameStatistics::Clock::now())
34{
35}

Friends And Related Function Documentation

◆ FrameStatistics

friend class FrameStatistics
friend

Definition at line 66 of file FrameStatistics.h.

Member Data Documentation

◆ mSection

SectionID FrameStatistics::Stopwatch::mSection
private

Definition at line 63 of file FrameStatistics.h.

Referenced by ~Stopwatch().

◆ mStart

Timepoint FrameStatistics::Stopwatch::mStart
private

Definition at line 64 of file FrameStatistics.h.

Referenced by ~Stopwatch().


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