JUCE  v5.4.1-191-g0ab5e696f
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::ScopedTimeMeasurement Class Reference

Simple RAII class for measuring the time spent in a scope. More...

#include <juce_PerformanceCounter.h>

Collaboration diagram for juce::ScopedTimeMeasurement:

Public Member Functions

 ScopedTimeMeasurement (double &resultInSeconds) noexcept
 
 ~ScopedTimeMeasurement ()
 

Private Attributes

double & result
 
int64 startTimeTicks = Time::getHighResolutionTicks()
 

Detailed Description

Simple RAII class for measuring the time spent in a scope.

Example:

{ double timeSec;

{ ScopedTimeMeasurement m (timeSec); doSomething(); }

Logger::writeToLog ("doSomething() took " + String (timeSec) + "seconds"); }

Parameters
resultInSecondsThe result of the measurement will be stored in this variable.

{Core}

Constructor & Destructor Documentation

◆ ScopedTimeMeasurement()

juce::ScopedTimeMeasurement::ScopedTimeMeasurement ( double &  resultInSeconds)
inlinenoexcept

◆ ~ScopedTimeMeasurement()

juce::ScopedTimeMeasurement::~ScopedTimeMeasurement ( )
inline

Member Data Documentation

◆ result

double& juce::ScopedTimeMeasurement::result
private

◆ startTimeTicks

int64 juce::ScopedTimeMeasurement::startTimeTicks = Time::getHighResolutionTicks()
private

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