lib/functions.php

Aleksander Machniak machniak at kolabsys.com
Tue Apr 10 11:10:58 CEST 2012


 lib/functions.php |    9 +++++++++
 1 file changed, 9 insertions(+)

New commits:
commit 15c708059b62c9888a3942d129957251e76dc0ea
Author: Aleksander Machniak <machniak at kolabsys.com>
Date:   Tue Apr 10 11:10:45 2012 +0200

    Added timer() function

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;
+}





More information about the commits mailing list