timer_stop

Versions
mediamosa-21
timer_stop($name)

Stop the timer with the specified name.

Parameters

name The name of the timer.

Return value

A timer array. The array contains the number of times the timer has been started and stopped (count) and the accumulated timer value in ms (time).

▾ 1 function calls timer_stop()

devel_themer_catch_function in sites/all/modules/devel/devel_themer.module
Intercepts all theme calls (including templates), adds to template log, and dispatches to original theme function. This function gets injected into theme registry in devel_exit().

Code

includes/bootstrap.inc, line 294

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

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

  return $timers[$name];
}
?>