JUCE  v6.1.6 (6.0.8-1114)
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.

@tags{Core}

Constructor & Destructor Documentation

◆ ScopedTimeMeasurement()

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

References juce::gl::result.

◆ ~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: