acctman Posted October 7, 2008 Share Posted October 7, 2008 Is there a way to print the processing time and the amount of CPU plus memory used in the process? Quote Link to comment Share on other sites More sharing options...
trecool999 Posted October 7, 2008 Share Posted October 7, 2008 You can measure the time it took to load the page but not the CPU used. <?php $mTime = explode(" ", microtime()); $mTime = $mTime[0] + $mTime[1]; $start = $mTime; //Any code here $mTime = explode(" ", microtime()); $mTime = $mTime[0] + $mTime[1]; $finish = $mTime; $total = ($finish - $start); echo "Page generated in " . round($total, 3) . " seconds"; ?> Quote Link to comment Share on other sites More sharing options...
Barand Posted October 7, 2008 Share Posted October 7, 2008 instead of $mTime = explode(" ", microtime()); $mTime = $mTime[0] + $mTime[1]; $start = $mTime; you can $start = microtime(true); 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.