| 5 bootstrap.inc | timer_read($name) |
| 6 bootstrap.inc | timer_read($name) |
| 7 bootstrap.inc | timer_read($name) |
| 8 bootstrap.inc | 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.
3 calls to timer_read()
File
- includes/
bootstrap.inc, line 131 - Functions that need to be loaded on every Drupal request.
Code
function timer_read($name) {
global $timers;
if (isset($timers[$name]['start'])) {
list($usec, $sec) = explode(' ', microtime());
$stop = (float) $usec + (float) $sec;
$diff = round(($stop - $timers[$name]['start']) * 1000, 2);
if (isset($timers[$name]['time'])) {
$diff += $timers[$name]['time'];
}
return $diff;
}
}
Login or register to post comments