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

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

parent 7f25862f
......@@ -57,6 +57,7 @@ function timer_start($name) {
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);
......@@ -65,6 +66,7 @@ function timer_read($name) {
$diff += $timers[$name]['time'];
}
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