SPEEDYB.co.uk

Saturday th 3rd of September 2005 at around six in the evening
I 've added the lovely little stat of render time to the bottom of the site again, along with the hits (presented as now/today, for reference sake) however the render time works on all pages with the exception of gallery.php.

At first I thought that this was due to the fact, maybe a variable name I was using had already been used somewhere in picKLE. But I changed all the variables and still, the same happens. It still seems to think the render time is around 1,125,770,260.7810, which happens to be about 35 years, and I don't recall waiting 35 years for the page to load. The code I'm currently using looks like so:

Page Top:
    $MYstarttime = microtime();


Page Bottom:
render: <?php
   $MYendtime = microtime();
   $MYstime = explode(' ', $MYstarttime);
   $MYstart = $MYstime[0] + $MYstime[1];
   $MYetime = explode(' ', $MYendtime);
   $MYend = $MYetime[0] + $MYetime[1];
   echo number_format($MYend - $MYstart, 4);
?>


Does anyone have any idea's on what could be causing the problem? or even if there's a better way of checking the render time?
3 Comments
RSS Feeds Subscribe to: These comments, All Comments, All Posts
Gravatar
Geffy @ 04 Sep 2005

I use this
<?php
$precision = 8;
list($susec, $ssec) = explode(" ", $start);
list($eusec, $esec) = explode(" ", $finish);

$start = (float)$ssec + (float)$susec;
$finish = (float)$esec + (float)$eusec;

echo number_format($finish - $start, $precision);
?>

but thats part of my timer class, available here
weblog.source.geffy.co.uk
Gravatar
Geffy @ 04 Sep 2005

the code above might be slightly confusing, its from a function where $precision, $start and $finish are all normally passed in as parameters, $precision is then set by a function that checks the $precision parameter.
Gravatar
David @ 06 Sep 2005

Not sure why you're making your own floats here.

You could be using:

<?php
$start_time = microtime(true);
echo number_format(microtime(true) - $start_time, 4);
?>
Add Your Comment...
Name
Web site (optional)
E-Mail (optional, used for Gravatar)