Script to check server speed

Most of the time, we do face issue with the Dedicated and VPS/Cloud server speed, the web sites are loading fine but we are not sure, if its really server side speed issue or the clients web sites issue. In that case create the simle php page under the hosting account and insert the following code.

Login in to the shell and create the new file.

speedchecker.php

Insert the following code in the speedchecker.php.

<?
$starttime = explode(‘ ‘, microtime());
$starttime = $starttime[1] + $starttime[0];

$starttime = explode(‘ ‘, microtime()); $starttime = $starttime[1] + $starttime[0];
$mtime = explode(‘ ‘, microtime());
$totaltime = $mtime[0] + $mtime[1] – $starttime;
printf(‘Page loaded in %.3f seconds.’, $totaltime);
?>

Now browse the web page as http://yourdomain.com/speedchecker.php , it will show you the loading time for web page speedchecker.php.

Page loaded in 0.005 seconds

 

About Anant 384 Articles
Senior technical writer