timer_read

Хочешь помочь с переводом? Это очень просто и быстро. Лишь зарегистрируйся, и можешь тут же начать переводить.

includes/bootstrap.inc, строка 131

Версии
5 – 6
timer_read($name)

Read the current timer value without stopping the timer.

Параметры

name The name of the timer.

Возвращаемое значение

The current timer value in ms.

▾ 3 функции вызывают timer_read()

statistics_exit in modules/statistics/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.

Код

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

  if (isset($timers[$name]['start'])) {
    list($usec, $sec) = explode(' ', microtime());
    $stop = (float)$usec + (float)$sec;
    $diff = round(($stop - $timers[$name]['start']) * 1000, 2);

    if (isset($timers[$name]['time'])) {
      $diff += $timers[$name]['time'];
    }
    return $diff;
  }
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

Вход в систему