summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2008-10-16 21:16:06 +0000
committerDries Buytaert <dries@buytaert.net>2008-10-16 21:16:06 +0000
commitf7eac0049a7301099332c2807c1dc03eb7436b2b (patch)
treea5821d190232ac19acdb35a670bc15a1b9d00a1b /includes
parentf1fda0f0364d0af37d56e4481090b3833724074b (diff)
downloadbrdo-f7eac0049a7301099332c2807c1dc03eb7436b2b.tar.gz
brdo-f7eac0049a7301099332c2807c1dc03eb7436b2b.tar.bz2
- Patch #321337 by gpk: optmized timer_start() and timer_read() thanks to PHP5.
Diffstat (limited to 'includes')
-rw-r--r--includes/bootstrap.inc6
1 files changed, 2 insertions, 4 deletions
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index c8ac6e7a0..f7e9b2655 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -217,8 +217,7 @@ define('PASS_THROUGH', -1);
function timer_start($name) {
global $timers;
- list($usec, $sec) = explode(' ', microtime());
- $timers[$name]['start'] = (float)$usec + (float)$sec;
+ $timers[$name]['start'] = microtime(TRUE);
$timers[$name]['count'] = isset($timers[$name]['count']) ? ++$timers[$name]['count'] : 1;
}
@@ -234,8 +233,7 @@ function timer_read($name) {
global $timers;
if (isset($timers[$name]['start'])) {
- list($usec, $sec) = explode(' ', microtime());
- $stop = (float)$usec + (float)$sec;
+ $stop = microtime(TRUE);
$diff = round(($stop - $timers[$name]['start']) * 1000, 2);
if (isset($timers[$name]['time'])) {