timer_read
- Versions
- 4.7 – 7
timer_read($name)
Read the current timer value without stopping the timer.
Parameters
name The name of the timer.
Return value
The current timer value in ms.
Code
includes/bootstrap.inc, line 52
<?php
function timer_read($name) {
global $timers;
list($usec, $sec) = explode(' ', microtime());
$stop = (float)$usec + (float)$sec;
$diff = round(($stop - $timers[$name]['start']) * 1000, 2);
return $timers[$name]['time'] + $diff;
}
?>Login or register to post comments 