summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Drumm <drumm@3064.no-reply.drupal.org>2006-11-12 00:21:15 +0000
committerNeil Drumm <drumm@3064.no-reply.drupal.org>2006-11-12 00:21:15 +0000
commit723056cbb9937fef046e678948aebb2d3758cfb4 (patch)
tree2710ab54b8bf35ecc09f2223be73a2118eaa8ba5
parent7f25862f955c94fb5eda389bd8848d6b5f64b1c8 (diff)
downloadbrdo-723056cbb9937fef046e678948aebb2d3758cfb4.tar.gz
brdo-723056cbb9937fef046e678948aebb2d3758cfb4.tar.bz2
#93491 by chx. Don't attempt to read non-existent timers.
-rw-r--r--includes/bootstrap.inc14
1 files 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;
}
/**