class ProfilerSimple extends Profiler {
var $mMinimumTime = 0;
var $mProfileID = false;
- var $mTemplated = false;
function __construct() {
global $wgRequestTime, $wgRUstart;
}
}
- /**
- * Mark this call as templated or not
- * @param boolean $t
- */
- function setTemplated( $t ) {
- $this->mTemplated = $t;
- }
-
function profileIn($functionname) {
global $wgDebugFunctionEntry;
if ($wgDebugFunctionEntry) {
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 {
/* 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);
}