Jump to content

How can I make this better?


NeverPool

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.