* (bug 28010) Passing a non existant user to list=users gives internal error
[lhc/web/wiklou.git] / includes / ProfilerSimple.php
index 5d2a775..8aab1ec 100644 (file)
@@ -16,7 +16,6 @@ if ( !class_exists( 'Profiler' ) ) {
 class ProfilerSimple extends Profiler {
        var $mMinimumTime = 0;
        var $mProfileID = false;
-       var $mTemplated = false;
 
        function __construct() {
                global $wgRequestTime, $wgRUstart;
@@ -55,14 +54,6 @@ class ProfilerSimple extends Profiler {
                }
        }
 
-       /**
-        * Mark this call as templated or not
-        * @param boolean $t
-        */
-       function setTemplated( $t ) {
-               $this->mTemplated = $t;
-       }
-
        function profileIn($functionname) {
                global $wgDebugFunctionEntry;
                if ($wgDebugFunctionEntry) {
@@ -118,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 {
@@ -129,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);
        }