src/Debug/Debug.php
public function addStep($name, $level = null)
    {
        // if true : UP
        if ($level === true) {
            $this->level++;
        }

        $time  = microtime(true);
        $usage = memory_get_usage();
        $peak  = memory_get_peak_usage();
        $type  = ($level === true ? ' Begin' : ($level === false ? ' End' : ''));

        $this->displayLine(
            str_repeat('  ', $this->level) . $name . $type,
            number_format(($time - $this->startTime)*1000, 1, '.', ' ').' ms',
            number_format(($time - $this->lastTime)*1000, 1, '.', ' ').' ms',
            number_format($usage/1024, 1, '.', ' ').' Ko',
            number_format($peak/1024, 1, '.', ' ').' Ko'
        );

        $this->lastTime = $time;

        // it false : DOWN
        if ($level === false) {
            $this->level--;
        }

        return $this;
    }
public function addStep($name, $level = null)
    {
        // if true : UP
        if ($level === true) {
            $this->level++;
        }

        $time  = microtime(true);
        $usage = memory_get_usage();
        $peak  = memory_get_peak_usage();
        $type  = ($level === true ? ' Begin' : ($level === false ? ' End' : ''));

        $this->displayLine(
            str_repeat('  ', $this->level) . $name . $type,
            number_format(($time - $this->startTime)*1000, 1, '.', ' ').' ms',
            number_format(($time - $this->lastTime)*1000, 1, '.', ' ').' ms',
            number_format($usage/1024, 1, '.', ' ').' Ko',
            number_format($peak/1024, 1, '.', ' ').' Ko'
        );

        $this->lastTime = $time;

        // it false : DOWN
        if ($level === false) {
            $this->level--;
        }

        return $this;
    }
public function addStep ( $ name , $ level = null ) { // if true : UP if ( $ level === true ) { $ this -> level ++ ; } $ time = microtime ( true ) ; $ usage = memory_get_usage ( ) ; $ peak = memory_get_peak_usage ( ) ; $ type = ( $ level === true ? ' Begin' : ( $ level === false ? ' End' : '' ) ) ; $ this -> displayLine ( str_repeat ( '  ' , $ this -> level ) . $ name . $ type , number_format ( ( $ time - $ this -> startTime ) * 1000 , 1 , '.' , ' ' ) . ' ms' , number_format ( ( $ time - $ this -> lastTime ) * 1000 , 1 , '.' , ' ' ) . ' ms' , number_format ( $ usage / 1024 , 1 , '.' , ' ' ) . ' Ko' , number_format ( $ peak / 1024 , 1 , '.' , ' ' ) . ' Ko' ) ; $ this -> lastTime = $ time ; // it false : DOWN if ( $ level === false ) { $ this -> level -- ; } return $ this ; }
add a debug step

@param  string  $name step name
@param  boolean $level (true=up, false=down, null=nothing to do)

@return Debug
add a debug step