codexx Posted March 21, 2007 Share Posted March 21, 2007 Just wondering if there is any sort of function that allows you to see how long it took for the mySQL queries on that page to execute? Quote Link to comment https://forums.phpfreaks.com/topic/43741-time-it-took-to-execute-query/ Share on other sites More sharing options...
shaunrigby Posted March 21, 2007 Share Posted March 21, 2007 try takig the time before and after the query and minus time after from time before Quote Link to comment https://forums.phpfreaks.com/topic/43741-time-it-took-to-execute-query/#findComment-212378 Share on other sites More sharing options...
cmgmyr Posted March 21, 2007 Share Posted March 21, 2007 Add this to the top of the page: <?php $mtime = microtime(); $mtime = explode(" ",$mtime); $mtime = $mtime[1] + $mtime[0]; $starttime = $mtime; ?> and this to the bottom: <?php $mtime = microtime(); $mtime = explode(" ",$mtime); $mtime = $mtime[1] + $mtime[0]; $endtime = $mtime; $totaltime = ($endtime - $starttime); echo "This page was created in ".number_format($totaltime,6)." seconds"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/43741-time-it-took-to-execute-query/#findComment-212386 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.