Changeset 19611
- Timestamp:
- 12/20/2011 09:36:53 PM (14 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/load.php
r19593 r19611 183 183 184 184 /** 185 * PHP 4standard microtime start capture.185 * PHP 5 standard microtime start capture. 186 186 * 187 187 * @access private 188 188 * @since 0.71 189 * @global int $timestart Seconds and microseconds added togetherfrom when function is called.189 * @global float $timestart Seconds from when function is called. 190 190 * @return bool Always returns true. 191 191 */ 192 192 function timer_start() { 193 193 global $timestart; 194 $mtime = explode( ' ', microtime() ); 195 $timestart = $mtime[1] + $mtime[0]; 194 $timestart = microtime( true ); 196 195 return true; 197 196 } … … 214 213 * 215 214 * @since 0.71 216 * @global int $timestart Seconds and microseconds added togetherfrom when timer_start() is called217 * @global int $timeend Seconds and microseconds added togetherfrom when function is called215 * @global float $timestart Seconds from when timer_start() is called 216 * @global float $timeend Seconds from when function is called 218 217 * 219 218 * @param int $display Use '0' or null to not echo anything and 1 to echo the total time … … 223 222 function timer_stop( $display = 0, $precision = 3 ) { // if called like timer_stop(1), will echo $timetotal 224 223 global $timestart, $timeend; 225 $mtime = microtime(); 226 $mtime = explode( ' ', $mtime ); 227 $timeend = $mtime[1] + $mtime[0]; 224 $timeend = microtime( true ); 228 225 $timetotal = $timeend - $timestart; 229 226 $r = ( function_exists( 'number_format_i18n' ) ) ? number_format_i18n( $timetotal, $precision ) : number_format( $timetotal, $precision ); -
trunk/wp-includes/wp-db.php
r19593 r19611 1442 1442 */ 1443 1443 function timer_start() { 1444 $mtime = explode( ' ', microtime() ); 1445 $this->time_start = $mtime[1] + $mtime[0]; 1444 $this->time_start = microtime( true ); 1446 1445 return true; 1447 1446 } … … 1452 1451 * @since 1.5.0 1453 1452 * 1454 * @return int Total time spent on the query, in milliseconds1453 * @return float Total time spent on the query, in seconds 1455 1454 */ 1456 1455 function timer_stop() { 1457 $mtime = explode( ' ', microtime() ); 1458 $time_end = $mtime[1] + $mtime[0]; 1459 $time_total = $time_end - $this->time_start; 1460 return $time_total; 1456 return ( microtime( true ) - $this->time_start ); 1461 1457 } 1462 1458
Note: See TracChangeset
for help on using the changeset viewer.