Firelight Technologies FMOD Studio API
System::getCPUUsage
Retrieves in percent of CPU time - the amount of cpu usage that FMOD is taking for streaming/mixing and System::update combined.
C++ Syntax
FMOD_RESULT System::getCPUUsage(
float *dsp,
float *stream,
float *geometry,
float *update,
float *total
);
C Syntax
FMOD_RESULT FMOD_System_GetCPUUsage(
FMOD_SYSTEM *system,
float *dsp,
float *stream,
float *geometry,
float *update,
float *total
);
C# Syntax
RESULT System.getCPUUsage(
out float dsp,
out float stream,
out float geometry,
out float update,
out float total
);
JavaScript Syntax
System.getCPUUsage(
usage // writes value to usage.val
);
Parameters
- dsp
- Address of a variable that receives the current dsp mixing engine cpu usage. Result will be from 0 to 100.0f. Optional. Specify 0 or NULL to ignore.
- stream
- Address of a variable that receives the current streaming engine cpu usage. Result will be from 0 to 100.0f. Optional. Specify 0 or NULL to ignore.
- geometry
- Address of a variable that receives the current geometry engine cpu usage. Result will be from 0 to 100.0f. Optional. Specify 0 or NULL to ignore.
- update
- Address of a variable that receives the current System::update cpu usage. Result will be from 0 to 100.0f. Optional. Specify 0 or NULL to ignore.
- total
- Address of a variable that receives the current total cpu usage. Result will be from 0 to 100.0f. Optional. Specify 0 or NULL to ignore.
Return Values
If the function succeeds then the return value is FMOD_OK.
If the function fails then the return value will be one of the values defined in the FMOD_RESULT enumeration.
Remarks
This value is slightly smoothed to provide more stable readout (and to round off spikes that occur due to multitasking/operating system issues).
NOTE! On ps3 and xbox360, the dsp and stream figures are NOT main cpu/main thread usage. On PS3 this is the percentage of SPU being used. On Xbox 360 it is the percentage of a hardware thread being used which is on a totally different CPU than the main one.
Do not be alarmed if the usage for these platforms reaches over 50%, this is normal and should be ignored if you are playing a lot of compressed sounds and are using effects. The only value on the main cpu / main thread to take note of here that will impact your framerate is the update value, and this is typically very low (ie less than 1%).
See Also
Version 1.10.03 Built on Feb 1, 2018