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.
Код
<?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;
}
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии