You are here

function timer_read in Drupal 4

Same name and namespace in other branches
  1. 5 includes/bootstrap.inc \timer_read()
  2. 6 includes/bootstrap.inc \timer_read()
  3. 7 includes/bootstrap.inc \timer_read()

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()
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.

File

includes/bootstrap.inc, line 52
Functions that need to be loaded on every Drupal request.

Code

function timer_read($name) {
  global $timers;
  list($usec, $sec) = explode(' ', microtime());
  $stop = (double) $usec + (double) $sec;
  $diff = round(($stop - $timers[$name]['start']) * 1000, 2);
  return $timers[$name]['time'] + $diff;
}