Profiling::CpuUsage Class Reference

Class to provide a CPU usage indication based on task callback availability. More...

#include <CpuUsage.h>

Public Member Functions

void begin (InterruptCallback ready)
 Calibrate the baseline figure for minimum CPU usage. More...
 
void reset ()
 Reset counters to start a new update period. More...
 
unsigned getLoopIterations ()
 Get the number of task callbacks made so far. More...
 
uint32_t getElapsedCycles ()
 Get the total number of CPU cycles since the last call to reset() More...
 
uint32_t getMinLoopCycles ()
 Get the figure used as the baseline cycle count. More...
 
unsigned getUtilisation ()
 Get the CPU utilisation figure in 1/100ths of a percent. More...
 

Detailed Description

Class to provide a CPU usage indication based on task callback availability.

Member Function Documentation

◆ begin()

void Profiling::CpuUsage::begin ( InterruptCallback  ready)
inline

Calibrate the baseline figure for minimum CPU usage.

Parameters
readyFunction to call when calibration is complete
Note
Typically call this in init()

◆ getElapsedCycles()

uint32_t Profiling::CpuUsage::getElapsedCycles ( )
inline

Get the total number of CPU cycles since the last call to reset()

◆ getLoopIterations()

unsigned Profiling::CpuUsage::getLoopIterations ( )
inline

Get the number of task callbacks made so far.

◆ getMinLoopCycles()

uint32_t Profiling::CpuUsage::getMinLoopCycles ( )
inline

Get the figure used as the baseline cycle count.

◆ getUtilisation()

unsigned Profiling::CpuUsage::getUtilisation ( )
inline

Get the CPU utilisation figure in 1/100ths of a percent.

◆ reset()

void Profiling::CpuUsage::reset ( )
inline

Reset counters to start a new update period.


The documentation for this class was generated from the following file: