mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-12-06 12:51:58 +00:00
Ask for a float from microtime() for timer_start(), timer_stop(). Clarify docs. props solarissmoke, fixes #19157.
git-svn-id: https://develop.svn.wordpress.org/trunk@19611 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1441,8 +1441,7 @@ class wpdb {
|
||||
* @return true
|
||||
*/
|
||||
function timer_start() {
|
||||
$mtime = explode( ' ', microtime() );
|
||||
$this->time_start = $mtime[1] + $mtime[0];
|
||||
$this->time_start = microtime( true );
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1451,13 +1450,10 @@ class wpdb {
|
||||
*
|
||||
* @since 1.5.0
|
||||
*
|
||||
* @return int Total time spent on the query, in milliseconds
|
||||
* @return float Total time spent on the query, in seconds
|
||||
*/
|
||||
function timer_stop() {
|
||||
$mtime = explode( ' ', microtime() );
|
||||
$time_end = $mtime[1] + $mtime[0];
|
||||
$time_total = $time_end - $this->time_start;
|
||||
return $time_total;
|
||||
return ( microtime( true ) - $this->time_start );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user