From 3c799396d6918fc408ef6b926d5db2a99a614489 Mon Sep 17 00:00:00 2001 From: "Mr. E23" Date: Wed, 18 Feb 2004 19:12:55 +0000 Subject: [PATCH] Replaced uses of microtime() with wfTime() where possible. --- includes/GlobalFunctions.php | 3 +-- includes/OutputPage.php | 4 +--- includes/SpecialAsksql.php | 6 ++---- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index eac5e55ebf..e77cb554f5 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -200,8 +200,7 @@ function logProfilingData() { global $wgRequestTime, $wgDebugLogFile; global $wgProfiling, $wgProfileStack, $wgProfileLimit, $wgUser; - list( $usec, $sec ) = explode( " ", microtime() ); - $now = (float)$sec + (float)$usec; + $now = wfTime(); list( $usec, $sec ) = explode( " ", $wgRequestTime ); $start = (float)$sec + (float)$usec; diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 1285ebcf56..9c798787de 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -401,9 +401,7 @@ class OutputPage { { global $wgRequestTime; - list( $usec, $sec ) = explode( " ", microtime() ); - $now = (float)$sec + (float)$usec; - + $now = wfTime(); list( $usec, $sec ) = explode( " ", $wgRequestTime ); $start = (float)$sec + (float)$usec; $elapsed = $now - $start; diff --git a/includes/SpecialAsksql.php b/includes/SpecialAsksql.php index b4280b3b8a..b5116efc30 100644 --- a/includes/SpecialAsksql.php +++ b/includes/SpecialAsksql.php @@ -156,16 +156,14 @@ class SqlQueryForm { " query by " . $wgUser->getName() . ":\n$q\n" ); fclose( $f ); - $this->starttime = microtime(); + $this->starttime = wfTime(); } function logFinishedQuery() { global $wgSqlLogFile, $wgLogQueries; if(!$wgLogQueries) return; - list($sec, $usec) = explode( " ", microtime() ); - list($sec1, $usec1) = explode( " ", $this->starttime ); - $interval = ($sec + $usec) - ($sec1 + $usec1); + $interval = wfTime() - $this->starttime; $f = fopen( $wgSqlLogFile, "a" ); fputs( $f, "finished at " . wfTimestampNow() . "; took $interval secs\n" ); -- 2.20.1