This timer is easy to implement and determines the time taken for a php script to execute correct to a microsecond.
Insert this code at the top of the page:
Code:
<?php
$mtime = microtime();
$mtime = explode(' ', $mtime);
$mtime = $mtime[1] + $mtime[0];
$starttime = $mtime;
?> Then at the bottom of the page add the following:
Code:
<?php
$mtime = microtime();
$mtime = explode(" ", $mtime);
$mtime = $mtime[1] + $mtime[0];
$endtime = $mtime;
$totaltime = ($endtime - $starttime);
echo 'This page was created in ' .$totaltime. ' seconds.';
?> PHP's microtime() function returns the current Unix timestamp with microseconds.