JUCE
|
Maintains an ongoing measurement of the proportion of time which is being spent inside an audio callback. More...
Classes | |
struct | ScopedTimer |
This class measures the time between its construction and destruction and adds it to an AudioProcessLoadMeasurer. More... | |
Public Member Functions | |
AudioProcessLoadMeasurer () | |
~AudioProcessLoadMeasurer () | |
Destructor. More... | |
void | reset () |
Resets the state. More... | |
void | reset (double sampleRate, int blockSize) |
Resets the counter, in preparation for use with the given sample rate and block size. More... | |
double | getLoadAsProportion () const |
Returns the current load as a proportion 0 to 1.0. More... | |
double | getLoadAsPercentage () const |
Returns the current load as a percentage 0 to 100.0. More... | |
int | getXRunCount () const |
Returns the number of over- (or under-) runs recorded since the state was reset. More... | |
void | registerBlockRenderTime (double millisecondsTaken) |
Can be called manually to add the time of a callback to the stats. More... | |
Maintains an ongoing measurement of the proportion of time which is being spent inside an audio callback.
AudioProcessLoadMeasurer::AudioProcessLoadMeasurer | ( | ) |
AudioProcessLoadMeasurer::~AudioProcessLoadMeasurer | ( | ) |
Destructor.
void AudioProcessLoadMeasurer::reset | ( | ) |
Resets the state.
void AudioProcessLoadMeasurer::reset | ( | double | sampleRate, |
int | blockSize | ||
) |
Resets the counter, in preparation for use with the given sample rate and block size.
double AudioProcessLoadMeasurer::getLoadAsProportion | ( | ) | const |
Returns the current load as a proportion 0 to 1.0.
double AudioProcessLoadMeasurer::getLoadAsPercentage | ( | ) | const |
Returns the current load as a percentage 0 to 100.0.
int AudioProcessLoadMeasurer::getXRunCount | ( | ) | const |
Returns the number of over- (or under-) runs recorded since the state was reset.
void AudioProcessLoadMeasurer::registerBlockRenderTime | ( | double | millisecondsTaken | ) |
Can be called manually to add the time of a callback to the stats.
Normally you probably would never call this - it's simpler and more robust to use a ScopedTimer to measure the time using an RAII pattern.