Replace microtime_float() by microtime(true).

This commit is contained in:
Markus Birth 2022-02-13 23:02:08 +01:00
parent 12e9df52de
commit fc78f871ed
Signed by: mbirth
GPG Key ID: A9928D7A098C3A9A
3 changed files with 4 additions and 18 deletions

View File

@ -1240,20 +1240,6 @@ function serendipity_request_url($uri, $method = 'GET', $contenttype = null, $da
return $fContent;
}
if (!function_exists('microtime_float')) {
/**
* Get current timestamp as microseconds
*
* @access public
* @return float the time
*/
function microtime_float() {
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}
}
/**
* Converts Array data to be used as a GET string
*

View File

@ -1578,7 +1578,7 @@ function serendipity_displayImageList($page = 0, $lineBreak = NULL, $manage = fa
if ($debug) echo "<p>Got files: <pre>" . print_r($aFilesOnDisk, true) . "</pre></p>";
$serendipity['current_image_hash'] = md5(serialize($aFilesOnDisk));
$nTimeStart = microtime_float();
$nTimeStart = microtime(true);
// MTG 21/01/06: request all images from the database, delete any which don't exist
// on the filesystem, and mark off files from the file list which are already
// in the database
@ -1689,7 +1689,7 @@ function serendipity_displayImageList($page = 0, $lineBreak = NULL, $manage = fa
}
/*
$nTimeEnd = microtime_float ( );
$nTimeEnd = microtime(true);
$nDifference = $nTimeEnd - $nTimeStart;
echo "<p> total time taken was " . $nDifference . "</p>";
*/

View File

@ -140,7 +140,7 @@ class SqlRelayDatabase extends DbAbstract
$this->db_cursor = $cur;
if ($benchmark) {
$start = microtime_float();
$start = microtime(true);
}
if ($expectError) {
@ -150,7 +150,7 @@ class SqlRelayDatabase extends DbAbstract
}
if ($benchmark) {
$end = microtime_float();
$end = microtime(true);
$cur = sqlrcur_alloc($this->db_conn);
$sql_b = "INSERT INTO BLOGLOG (request, timestamp, sql, exec_time, ip) VALUES ('" . $this->escapeString($_SERVER['REQUEST_URI']) . "', NOW(), '" . $this->escapeString($sql) . "', '" . (number_format($end-$start, 10)) . "', '" . $this->escapeString($_SERVER['REMOTE_ADDR']) . "')";