summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2012-04-10 11:10:45 +0200
committerAleksander Machniak <machniak@kolabsys.com>2012-04-10 11:10:45 +0200
commit15c708059b62c9888a3942d129957251e76dc0ea (patch)
treea46a07aa1f75fb42d93fe287a2a3d88ea6da418b
parent0ff0e866114ef705b11e5dc196eba859f9a0dc37 (diff)
downloadwebadmin-15c708059b62c9888a3942d129957251e76dc0ea.tar.gz
Added timer() function
-rw-r--r--lib/functions.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/functions.php b/lib/functions.php
index ce3ea3a..441752f 100644
--- a/lib/functions.php
+++ b/lib/functions.php
@@ -119,3 +119,12 @@ function write_log($name, $line)
return false;
}
+
+function timer($time = null, $label = '')
+{
+ $now = microtime(true);
+ if ($time) {
+ console(($label ? $label.' ' : '') . sprintf('%.4f', $now - $time));
+ }
+ return $now;
+}