summaryrefslogtreecommitdiff
path: root/includes/bootstrap.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/bootstrap.inc')
-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;
}
/**