Skip to content

daisy::CpuLoadMeter

#include <CpuLoadMeter.h>

Public Functions

Name
CpuLoadMeter()
void Init(float sampleRateInHz, int blockSizeInSamples, float smoothingFilterCutoffHz =1.0f)
void OnBlockStart()
void OnBlockEnd()
float GetAvgCpuLoad() const
float GetMinCpuLoad() const
float GetMaxCpuLoad() const
void Reset()

Public Functions Documentation

function CpuLoadMeter

inline CpuLoadMeter()

function Init

inline void Init(
    float sampleRateInHz,
    int blockSizeInSamples,
    float smoothingFilterCutoffHz =1.0f
)

Parameters:

  • sampleRateInHz The sample rate in Hz
  • blockSizeInSamples The block size in samples
  • smoothingFilterCutoffHz The cutoff frequency of the smoothing filter that's used to create the average CPU load reading.

Initializes the CpuLoadMeter for a particular sample rate and block size.


function OnBlockStart

inline void OnBlockStart()

Call this at the beginning of your audio callback


function OnBlockEnd

inline void OnBlockEnd()

Call this at the end of your audio callback


function GetAvgCpuLoad

inline float GetAvgCpuLoad() const

Returns the smoothed average CPU load in the range 0..1


function GetMinCpuLoad

inline float GetMinCpuLoad() const

Returns the minimun CPU load observed since the last call to Reset().


function GetMaxCpuLoad

inline float GetMaxCpuLoad() const

Returns the maximum CPU load observed since the last call to Reset().


function Reset

inline void Reset()

Resets the minimun, maximum and average load readings.

---

Updated on 2024-01-03 at 19:41:00 +0000