0
I am using a function to get the server load:
function get_server_cpu_usage(){
$load = sys_getloadavg();
return $load[1];
}
I call her with:
<div id="load"><?= get_server_cpu_usage(); ?></div>
I need to implement something to update this information every second, without the page being updated, something like JS setTimeout or setInterval.
How can I do that in this case?
If you really want to use PHP, it would be best to implement long Polling.
– Filipe Moraes