Simple RAII class for measuring the time spent in a scope. More...
#include <juce_PerformanceCounter.h>
Public Member Functions | |
ScopedTimeMeasurement (double &resultInSeconds) | |
~ScopedTimeMeasurement () | |
Private Attributes | |
double & | result |
int64 | startTimeTicks = Time::getHighResolutionTicks() |
Simple RAII class for measuring the time spent in a scope.
Example:
{ double timeSec;
{ ScopedTimeMeasurement m (timeSec); doSomething(); }
Logger::writeToLog (String ("doSomething() took ") + String (timeSec) + "seconds"); }
resultInSeconds | The result of the measurement will be stored in this variable. |
|
inline |
|
inline |
References Time::getHighResolutionTicks(), and Time::getHighResolutionTicksPerSecond().
|
private |
|
private |