Commit cec41faf authored by Dries's avatar Dries
Browse files

- Patch #723436 by mikeryan: timers accumulated at double-speed in certain scenarios.

parent 0f712430
...@@ -296,13 +296,17 @@ function timer_read($name) { ...@@ -296,13 +296,17 @@ function timer_read($name) {
function timer_stop($name) { function timer_stop($name) {
global $timers; global $timers;
if (isset($timers[$name]['time'])) { if (isset($timers[$name]['start'])) {
$timers[$name]['time'] += timer_read($name); $stop = microtime(TRUE);
} $diff = round(($stop - $timers[$name]['start']) * 1000, 2);
else { if (isset($timers[$name]['time'])) {
$timers[$name]['time'] = timer_read($name); $timers[$name]['time'] += $diff;
}
else {
$timers[$name]['time'] = $diff;
}
unset($timers[$name]['start']);
} }
unset($timers[$name]['start']);
return $timers[$name]; return $timers[$name];
} }
......
Supports Markdown
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