From 723056cbb9937fef046e678948aebb2d3758cfb4 Mon Sep 17 00:00:00 2001 From: Neil Drumm Date: Sun, 12 Nov 2006 00:21:15 +0000 Subject: #93491 by chx. Don't attempt to read non-existent timers. --- includes/bootstrap.inc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index 320ca3ac7..8e7390d2c 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -57,14 +57,16 @@ function timer_start($name) { function timer_read($name) { global $timers; - list($usec, $sec) = explode(' ', microtime()); - $stop = (float)$usec + (float)$sec; - $diff = round(($stop - $timers[$name]['start']) * 1000, 2); + 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']; + if (isset($timers[$name]['time'])) { + $diff += $timers[$name]['time']; + } + return $diff; } - return $diff; } /** -- cgit v1.2.3