30 AudioProcessLoadMeasurer::AudioProcessLoadMeasurer() {}
43 if (sampleRate > 0.0 && blockSize > 0)
45 msPerBlock = 1000.0 * blockSize / sampleRate;
46 timeToCpuScale = (msPerBlock > 0.0) ? (1.0 / msPerBlock) : 0.0;
57 const double filterAmount = 0.2;
58 cpuUsageMs += filterAmount * (milliseconds - cpuUsageMs);
60 if (milliseconds > msPerBlock)
74 AudioProcessLoadMeasurer::ScopedTimer::~ScopedTimer()
static double getMillisecondCounterHiRes() noexcept
Returns the number of millisecs since a fixed event (usually system startup).
~AudioProcessLoadMeasurer()
Destructor.
Maintains an ongoing measurement of the proportion of time which is being spent inside an audio callb...
void registerBlockRenderTime(double millisecondsTaken)
Can be called manually to add the time of a callback to the stats.
double getLoadAsPercentage() const
Returns the current load as a percentage 0 to 100.0.
double getLoadAsProportion() const
Returns the current load as a proportion 0 to 1.0.
int getXRunCount() const
Returns the number of over- (or under-) runs recorded since the state was reset.
void reset()
Resets the state.