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