JUCE: ScopedTimeMeasurement Class Reference

JUCE

- Main Page
- Related Pages
- Topics
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Loading...
Searching...
No Matches
Public Member Functions | List of all members
ScopedTimeMeasurement Class Reference
juce_core » time

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

`#include <juce_PerformanceCounter.h>`

## Public Member Functions
| ScopedTimeMeasurement (double &resultInSeconds) noexcept
| ~ScopedTimeMeasurement ()

## 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

  resultInSeconds | The result of the measurement will be stored in this variable.

## Constructor & Destructor Documentation

## ◆ ScopedTimeMeasurement()

ScopedTimeMeasurement::ScopedTimeMeasurement | ( | double & | resultInSeconds | ) |
| noexcept

## ◆ ~ScopedTimeMeasurement()

ScopedTimeMeasurement::~ScopedTimeMeasurement | ( |  | ) |

References Time::getHighResolutionTicks(), and Time::getHighResolutionTicksPerSecond().

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

- juce_PerformanceCounter.h