Showing users the page rendertime

Moderator: mcsmom

Post Reply
FrankS
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Mon Oct 10, 2005 11:26 pm

Showing users the page rendertime

Post by FrankS » Sun Feb 05, 2006 5:39 pm

Hi,

I hope this forum is the right place for this little tip. ;)

OK, let's start.

1. Open your template index.php
2. Put the following code next to

Code: Select all

<?php function getmicrotime() {
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec); }
$starttime = getmicrotime(); ?>

3. Now put the following code near to the bottom of your site (e.g. right before

Code: Select all

<?php $endtime = getmicrotime();
echo"This site was generated in<br />", number_format($endtime-$starttime, 4, ",", "."), " seconds."; ?>


That's all, easy I think. :D
Comments welcome.

Post Reply