if( $functionname == 'close' ){
$message = "Profile section ended by close(): {$bit[0]}";
$this->debug( "$message\n" );
- $this->mStack[] = array( $message, 0, '0 0', 0, '0 0', 0 );
+ $this->mStack[] = array( $message, 0, 0.0, 0, 0.0, 0 );
}
elseif( $bit[0] != $functionname ){
$message = "Profiling error: in({$bit[0]}), out($functionname)";
$this->debug( "$message\n" );
- $this->mStack[] = array( $message, 0, '0 0', 0, '0 0', 0 );
+ $this->mStack[] = array( $message, 0, 0.0, 0, 0.0, 0 );
}
//}
$bit[] = $time;
if ( $this->mTimeMetric === 'user' ) {
return $this->getUserTime();
} else {
- return microtime(true);
+ return microtime( true );
}
}
function getUserTime() {
$ru = getrusage();
- return $ru['ru_utime.tv_sec'].' '.$ru['ru_utime.tv_usec'] / 1e6;
+ return $ru['ru_utime.tv_sec'] + $ru['ru_utime.tv_usec'] / 1e6;
}
protected function collateData() {
return 0;
}
}
-
- /* 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) {
- return microtime(true);
- }
- list($a,$b)=explode(" ",$time);
- return (float)($a+$b);
- }
}