Stops the timer with the specified name.
string $name: The name of the timer.
array 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).
public static function stop($name) {
if (isset(static::$timers[$name]['start'])) {
$stop = microtime(TRUE);
$diff = round(($stop - static::$timers[$name]['start']) * 1000, 2);
if (isset(static::$timers[$name]['time'])) {
static::$timers[$name]['time'] += $diff;
}
else {
static::$timers[$name]['time'] = $diff;
}
unset(static::$timers[$name]['start']);
}
return static::$timers[$name];
}