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? Link to comment https://forums.phpfreaks.com/topic/127347-printecho-processing-time/ 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"; ?> Link to comment https://forums.phpfreaks.com/topic/127347-printecho-processing-time/#findComment-658783 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); Link to comment https://forums.phpfreaks.com/topic/127347-printecho-processing-time/#findComment-658799 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.