Remove some duplicate code in ProfilerSimpleTrace
Change-Id: Iab0b5343dbbd50419ba31724513b062f682c98df
This commit is contained in:
parent
05c27c3af1
commit
16b8d33ae8
1 changed files with 3 additions and 12 deletions
|
|
@ -10,20 +10,11 @@
|
|||
* @ingroup Profiler
|
||||
*/
|
||||
class ProfilerSimpleTrace extends ProfilerSimple {
|
||||
var $trace = "";
|
||||
var $trace = "Beginning trace: \n";
|
||||
var $memory = 0;
|
||||
|
||||
function addInitialStack() {
|
||||
$initialTime = $this->getInitialTime();
|
||||
$initialCpu = $this->getInitialTime( 'cpu' );
|
||||
if ( $initialTime !== null && $initialCpu !== null ) {
|
||||
$this->mWorkStack[] = array( '-total', 0, $initialTime, $initialCpu );
|
||||
}
|
||||
$this->trace .= "Beginning trace: \n";
|
||||
}
|
||||
|
||||
function profileIn($functionname) {
|
||||
$this->mWorkStack[] = array( $functionname, count( $this->mWorkStack ), $this->getTime(), $this->getTime( 'cpu' ) );
|
||||
function profileIn( $functionname ) {
|
||||
parent::profileIn( $functionname );
|
||||
$this->trace .= " " . sprintf("%6.1f",$this->memoryDiff()) .
|
||||
str_repeat( " ", count($this->mWorkStack)) . " > " . $functionname . "\n";
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue