Hi...
I have examined the code a little bit deeper, and I got a solution for these negative value problems, I think.
In my opinion it is a little bug in your hack. I figured out that my pagestarttime was always set to zero.
This is caused in global.php:
PHP Code:
if (isset($explain)) {
$showqueries=1;
}
if (isset($showqueries)) {
$pagestarttime=microtime();
}
so it will only be set if showqueries is set.
I changed it to:
PHP Code:
$pagestarttime=microtime();
if (isset($explain)) {
$showqueries=1;
}
if (isset($showqueries)) {
$pagestarttime=microtime();
}
so.. with this I got a start time. But there is an other little problem in functions.php.
replace this:
PHP Code:
// time format (how many digits you want to show)
$digits=7;
$totaltime=$endtime[0]-$starttime[0];
$trimmedtime=number_format($totaltime,$digits);
$percentphp=number_format(((($totaltime-$querytime)/$totaltime)*100), 2)."% PHP";
$percentsql=number_format((($querytime/$totaltime)*100), 2)."% MySQL";
with
PHP Code:
// time format (how many digits you want to show)
$digits=7;
$totaltime=$endtime[0]-$starttime[0]+$endtime[1]-$starttime[1];
$trimmedtime=number_format($totaltime,$digits);
$percentphp=number_format(((($totaltime-$querytime)/$totaltime)*100), 2)."% PHP";
$percentsql=number_format((($querytime/$totaltime)*100), 2)."% MySQL";
and now it should work perfectly, at least for me it does
Greets
JDD
If this may be wrong, just inform me and I edit this (but I think it should solve the problem)