Ah, one more thing:
<?
$page_start_time = microtime_float();
$round = 4;
$query_num = 0;
$query_time = array();
$query_start = microtime_float();
$return_1 = mysql_query($query_1);
$query_time[$query_num++] = microtime_float() - $query_start;
echo '<!-- There were ' . $query_num . ' queries executed. ';
$query_total_time = 0;
foreach ($query_time as $key => $val); {
[b]$query_total_time += $val;
echo ' Query number ' . $key + 1 . ' took ' . round($val, $round) . ' seconds to execute! '; [/b]
}
echo ' Total query execution time was ' . round($query_total_time, $round) . ' seconds. ';
$totaltime = microtime_float() - $page_start_time;
echo ' Total page generation time was ' . round($totaltime, $round) . ' seconds. -->';
function microtime_float ()
{
list ($msec, $sec) = explode(' ', microtime());
$microtime = (float)$msec + (float)$sec;
return $microtime;
}
?>
I get this outputted in the source:
<!-- There were 1 queries executed.[b] 1 took 0.0011 seconds to execute! [/b]Total query execution time was 0.0011 seconds. Total page generation time was 0.0013 seconds. -->
The output doesnt match the PHP code. It should read:
Query number 1 took 0.0011 seconds to execute!
No matter what i do to try to fix it, nothing works. Any suggestions?