Simple RAII class for measuring the time spent in a scope. More...
#include <juce_PerformanceCounter.h>
Public Member Functions | |
ScopedTimeMeasurement (double &resultInSeconds) noexcept | |
~ScopedTimeMeasurement () | |
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"); }
resultInSeconds | The result of the measurement will be stored in this variable. |
|
noexcept |
ScopedTimeMeasurement::~ScopedTimeMeasurement | ( | ) |
References Time::getHighResolutionTicks(), and Time::getHighResolutionTicksPerSecond().