dezkit Posted September 28, 2008 Share Posted September 28, 2008 Is there a script to determine how long it took to load the php document? If yes, can i get it? Thanks Quote Link to comment Share on other sites More sharing options...
peranha Posted September 28, 2008 Share Posted September 28, 2008 <?php // Function to calculate time taken to load a page. function microtime_float() { list($usec, $sec) = explode(" ", microtime()); return ((float)$usec + (float)$sec); // At beginning of page add '$start = microtime_float();' without the quotes. // At the end of the page add 'substr(microtime_float() - $start, 0, 5)' without the quotes. Change the 5 to whatever number of digits you want to display. 5 will output 0.000 } ?> Quote Link to comment Share on other sites More sharing options...
dezkit Posted September 28, 2008 Author Share Posted September 28, 2008 Thanks peranha, but i found a more shorter one hehe <?php $load = microtime(); echo (number_format($load,2)); ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.