Skip to main content
useCPULoad(params?): Object

Parameters (optional)

onCPULoadChange
Function
Event callback for the cpu-load-change event.

Return value

An object with the following properties:
state
string
‘low’ | ‘high’, an assessment of the current CPU state. See cpu-load-change for more details.
reason
string
‘none’ | ‘encode’ | ‘decode’ | ‘scheduleDuration’. See cpu-load-change for more details.
{
  "state": "low",
  "reason": "none"
}

Example

import { useCPULoad } from '@daily-co/daily-react';

export const UseCPULoadDemo = () => {
  const cpu = useCPULoad();

  return <div>CPU load: {cpu.state}</div>;
};

See also

daily-js methods