NeverPool Posted May 2, 2010 Share Posted May 2, 2010 Hullo I wrote this little script to show how long it takes a web page to load, and I want it to show exactly how long it takes, in milliseconds. Here's the code. <?php $time = round(microtime(), 3); //Page generation time top $time2 = round(microtime(), 3); //Page generation bottom $generation = $time2 - $time; substr($generation, 0, 5); echo "<p>This page took <strong>$generation seconds</strong> to render</p>"; ?> Link to comment https://forums.phpfreaks.com/topic/200498-how-can-i-make-this-better/ Share on other sites More sharing options...
ChemicalBliss Posted May 2, 2010 Share Posted May 2, 2010 pretty efficient how it is - only this: <?php $time = microtime(TRUE); //Page generation time top // bottom echo "<p>This page took <strong>".round((microtime(TRUE) - $time), 3)." seconds</strong> to render</p>"; ?> -cb- Link to comment https://forums.phpfreaks.com/topic/200498-how-can-i-make-this-better/#findComment-1052136 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.