|
LMMS
|
#include <juce_AudioProcessLoadMeasurer.h>
Classes | |
| struct | ScopedTimer |
Public Member Functions | |
| AudioProcessLoadMeasurer () | |
| ~AudioProcessLoadMeasurer () | |
| void | reset () |
| void | reset (double sampleRate, int blockSize) |
| double | getLoadAsProportion () const |
| double | getLoadAsPercentage () const |
| int | getXRunCount () const |
| void | registerBlockRenderTime (double millisecondsTaken) |
| void | registerRenderTime (double millisecondsTaken, int numSamples) |
Private Member Functions | |
| void | registerRenderTimeLocked (double, int) |
Private Attributes | |
| SpinLock | mutex |
| int | samplesPerBlock = 0 |
| double | msPerSample = 0 |
| std::atomic< double > | cpuUsageProportion { 0 } |
| std::atomic< int > | xruns { 0 } |
Maintains an ongoing measurement of the proportion of time which is being spent inside an audio callback.
@tags{Audio}
|
default |
|
default |
Destructor.
| double juce::AudioProcessLoadMeasurer::getLoadAsPercentage | ( | ) | const |
Returns the current load as a percentage 0 to 100.0
| double juce::AudioProcessLoadMeasurer::getLoadAsProportion | ( | ) | const |
Returns the current load as a proportion 0 to 1.0
| int juce::AudioProcessLoadMeasurer::getXRunCount | ( | ) | const |
Returns the number of over- (or under-) runs recorded since the state was reset.
| void juce::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.
| void juce::AudioProcessLoadMeasurer::registerRenderTime | ( | double | millisecondsTaken, |
| int | numSamples ) |
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.
|
private |
| void juce::AudioProcessLoadMeasurer::reset | ( | ) |
Resets the state.
Resets the counter, in preparation for use with the given sample rate and block size.
|
private |
|
private |
|
private |
|
private |
|
private |