timer_read

Versions
mediamosa-21
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.

▾ 5 functions call timer_read()

devel_timer in sites/all/modules/devel/devel.module
Displays page execution time at the bottom of the page.
drupal_http_request in includes/common.inc
Perform an HTTP request.
performance_shutdown in sites/all/modules/devel/performance/performance.module
statistics_exit in modules/statistics/statistics.module
Implements hook_exit().
_batch_process in includes/batch.inc
Process sets in a batch.

Code

includes/bootstrap.inc, line 270

<?php
function timer_read($name) {
  global $timers;

  if (isset($timers[$name]['start'])) {
    $stop = microtime(TRUE);
    $diff = round(($stop - $timers[$name]['start']) * 1000, 2);

    if (isset($timers[$name]['time'])) {
      $diff += $timers[$name]['time'];
    }
    return $diff;
  }
  return $timers[$name]['time'];
}
?>