timer_read

  1. drupal
    1. 4.7
    2. 5
    3. 6 bootstrap.inc
    4. 7 bootstrap.inc
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.

▾ 3 functions call timer_read()

statistics_exit in modules/statistics.module
Implementation of hook_exit().
timer_stop in includes/bootstrap.inc
Stop the timer with the specified name.
update_do_updates in ./update.php
Perform updates for one second or until finished.

Code

includes/bootstrap.inc, line 53

<?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;
}
?>