Page load time is independent on passing second.

Previously page loading time was calculated by taking miliseconds
of current wall clock time. In cases where wall clock went into another
second page loading time was calcualted as negative giving incorrect result.

This patch fixes this by using microtime of wall-clock time in float.
This commit is contained in:
uroskn
2016-07-03 00:01:15 +02:00
parent 5fc5c76b72
commit 234bd692e4
+2 -8
View File
@@ -148,17 +148,11 @@ if (date('Ymd',time()) == date('Ymd',$time)) {
}
public function pageLoadTimeStart() {
$starttime = microtime();
$startarray = explode(" ", $starttime);
//$starttime = $startarray[1] + $startarray[0];
return $startarray[0];
return microtime(true);
}
public function pageLoadTimeEnd() {
$endtime = microtime();
$endarray = explode(" ", $endtime);
//$endtime = $endarray[1] + $endarray[0];
return $endarray[0];
return microtime(true);
}
};