public function start($message = 'Start', $context = [])
    {
        // Check if method was called only with $context
        if (is_array($message)) {
            $context = $message;
            $message = 'Start';
        }

        // A profile can only be started if never started or cleared before
        if ($this->isStarted()) {
            throw new Exception("Profile {$this->getName()} already started.");
        }

        // The main profile
        if (null === $this->name) {
            if ($this->children) {
                throw new Exception("Profile {$this->getName()} must be started before all other profiles.");
            }
            $timeStart = $_SERVER['REQUEST_TIME_FLOAT'] ?? $this->timeCurrent();
        } else {
            $timeStart = $this->timeCurrent();
        }

        // Start counter and first lap
        $this->start  = $timeStart;
        $this->laps[] = $timeStart;

        // Log
        $this->note($message, $context);

        return $this;
    }
public function start($message = 'Start', $context = [])
    {
        // Check if method was called only with $context
        if (is_array($message)) {
            $context = $message;
            $message = 'Start';
        }

        // A profile can only be started if never started or cleared before
        if ($this->isStarted()) {
            throw new Exception("Profile {$this->getName()} already started.");
        }

        // The main profile
        if (null === $this->name) {
            if ($this->children) {
                throw new Exception("Profile {$this->getName()} must be started before all other profiles.");
            }
            $timeStart = $_SERVER['REQUEST_TIME_FLOAT'] ?? $this->timeCurrent();
        } else {
            $timeStart = $this->timeCurrent();
        }

        // Start counter and first lap
        $this->start  = $timeStart;
        $this->laps[] = $timeStart;

        // Log
        $this->note($message, $context);

        return $this;
    }
public function start ( $ message = 'Start' , $ context = [ ] ) { // Check if method was called only with $context if ( is_array ( $ message ) ) { $ context = $ message ; $ message = 'Start' ; } // A profile can only be started if never started or cleared before if ( $ this -> isStarted ( ) ) { throw new Exception ( "Profile {$this->getName()} already started." ) ; } // The main profile if ( null === $ this -> name ) { if ( $ this -> children ) { throw new Exception ( "Profile {$this->getName()} must be started before all other profiles." ) ; } $ timeStart = $ _SERVER [ 'REQUEST_TIME_FLOAT' ] ?? $ this -> timeCurrent ( ) ; } else { $ timeStart = $ this -> timeCurrent ( ) ; } // Start counter and first lap $ this -> start = $ timeStart ; $ this -> laps [ ] = $ timeStart ; // Log $ this -> note ( $ message , $ context ) ; return $ this ; }
Start this profile.

@param string $message [optional]
@param array  $context [optional]

@return $this
@throws Exception
Start this profile .