Commit 723056cb authored by drumm's avatar drumm
Browse files

#93491 by chx. Don't attempt to read non-existent timers.

parent 7f25862f
...@@ -57,14 +57,16 @@ function timer_start($name) { ...@@ -57,14 +57,16 @@ function timer_start($name) {
function timer_read($name) { function timer_read($name) {
global $timers; global $timers;
list($usec, $sec) = explode(' ', microtime()); if (isset($timers[$name]['start'])) {
$stop = (float)$usec + (float)$sec; list($usec, $sec) = explode(' ', microtime());
$diff = round(($stop - $timers[$name]['start']) * 1000, 2); $stop = (float)$usec + (float)$sec;
$diff = round(($stop - $timers[$name]['start']) * 1000, 2);
if (isset($timers[$name]['time'])) { if (isset($timers[$name]['time'])) {
$diff += $timers[$name]['time']; $diff += $timers[$name]['time'];
}
return $diff;
} }
return $diff;
} }
/** /**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment