how can i get my script's load?
Posted: Fri Jun 22, 2007 6:47 am
feyd | Please use
// -----------------------------------------------> Function - END
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
hello everyone,
how can i get my script's load? i just post a function to get system general load below. but this is not enough to me. i want to know only my script's load.
// -----------------------------------------------> Function - BEGINCode: Select all
function get_server_load()
{
$server_load_snapshot = '/proc/loadavg';
if(@file_exists($server_load_snapshot))
{
$load = file_get_contents($server_load_snapshot);
$load = explode(' ', ltrim($load));
return $load[0];
}
else
return '?';
}feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]