From 234bd692e4e1433dff455a62bc57a514dd74c034 Mon Sep 17 00:00:00 2001 From: uroskn Date: Sun, 3 Jul 2016 00:01:15 +0200 Subject: [PATCH] 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. --- GameEngine/Generator.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/GameEngine/Generator.php b/GameEngine/Generator.php index 296900c3..aff11e96 100755 --- a/GameEngine/Generator.php +++ b/GameEngine/Generator.php @@ -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); } };