Fix bug 26570 (user CSS preview broken) and bug 26555 (styles added with $out->addSty...
[lhc/web/wiklou.git] / includes / ProfilerSimple.php
index d3b8f45..8aab1ec 100644 (file)
@@ -1,11 +1,17 @@
 <?php
+/**
+ * @file
+ * @ingroup Profiler
+ */
 
-require_once(dirname(__FILE__).'/Profiler.php');
+if ( !class_exists( 'Profiler' ) ) {
+       require_once(dirname(__FILE__).'/Profiler.php');
+}
 
 /**
  * Simple profiler base class.
  * @todo document methods (?)
- * @addtogroup Profiler
+ * @ingroup Profiler
  */
 class ProfilerSimple extends Profiler {
        var $mMinimumTime = 0;
@@ -103,8 +109,9 @@ class ProfilerSimple extends Profiler {
 
        function getCpuTime($ru=null) {
                if ( function_exists( 'getrusage' ) ) {
-                       if ( $ru == null )
+                       if ( $ru == null ) {
                                $ru = getrusage();
+                       }
                        return ($ru['ru_utime.tv_sec'] + $ru['ru_stime.tv_sec'] + ($ru['ru_utime.tv_usec'] +
                                $ru['ru_stime.tv_usec']) * 1e-6);
                } else {
@@ -114,8 +121,9 @@ class ProfilerSimple extends Profiler {
 
        /* If argument is passed, it assumes that it is dual-format time string, returns proper float time value */
        function getTime($time=null) {
-               if ($time==null)
+               if ($time==null) {
                        return microtime(true);
+               }
                list($a,$b)=explode(" ",$time);
                return (float)($a+$b);
        }