mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-06-28 00:24:23 +00:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user