Displaying ads on a site causes a high server load,
here is a code to check the server load and if its low then show an ad.
here is a code to check the server load and if its low then show an ad.
PHP Code:
if(current_load()<50){
echo admob_request();
}
function current_load()
{
//GET SERVER LOADS
$loadresult = @exec('uptime');
preg_match("/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/",$loadresult,$avgs);
return $avgs[1];
}
Comment