src/Debug/Debug.php
public function profile($name = null)
    {
        if (!$this->cfg['collect']) {
            return;
        }
        if (!$this->cfg['enableProfiling']) {
            $callerInfo = $this->utilities->getCallerInfo();
            $this->appendLog(
                __FUNCTION__,
                array('Profile: Unable to start - enableProfiling opt not set.  ' . $callerInfo['file'] .' on line ' . $callerInfo['line'] . '.')
            );
            return;
        }
        $args = \func_get_args();
        $meta = $this->internal->getMetaVals(
            $args,
            array('channel' => $this->cfg['channel']),
            array('name' => null),
            array('name')   // move name to meta
        );
        if ($meta['name'] === null) {
            $meta['name'] = 'Profile '.$this->data['profileAutoInc'];
            $this->data['profileAutoInc']++;
        }
        $name = $meta['name'];
        $message = '';
        if (isset($this->data['profileInstances'][$name])) {
            $instance = $this->data['profileInstances'][$name];
            $instance->end();
            $instance->start();
            // move it to end (last started)
            unset($this->data['profileInstances'][$name]);
            $this->data['profileInstances'][$name] = $instance;
            $message = 'Profile \''.$name.'\' restarted';
        } else {
            $this->data['profileInstances'][$name] = $this->methodProfile; // factory
            $message = 'Profile \''.$name.'\' started';
        }
        $this->appendLog(
            __FUNCTION__,
            array(
                $message,
            ),
            $meta
        );
    }
public function profile($name = null)
    {
        if (!$this->cfg['collect']) {
            return;
        }
        if (!$this->cfg['enableProfiling']) {
            $callerInfo = $this->utilities->getCallerInfo();
            $this->appendLog(
                __FUNCTION__,
                array('Profile: Unable to start - enableProfiling opt not set.  ' . $callerInfo['file'] .' on line ' . $callerInfo['line'] . '.')
            );
            return;
        }
        $args = \func_get_args();
        $meta = $this->internal->getMetaVals(
            $args,
            array('channel' => $this->cfg['channel']),
            array('name' => null),
            array('name')   // move name to meta
        );
        if ($meta['name'] === null) {
            $meta['name'] = 'Profile '.$this->data['profileAutoInc'];
            $this->data['profileAutoInc']++;
        }
        $name = $meta['name'];
        $message = '';
        if (isset($this->data['profileInstances'][$name])) {
            $instance = $this->data['profileInstances'][$name];
            $instance->end();
            $instance->start();
            // move it to end (last started)
            unset($this->data['profileInstances'][$name]);
            $this->data['profileInstances'][$name] = $instance;
            $message = 'Profile \''.$name.'\' restarted';
        } else {
            $this->data['profileInstances'][$name] = $this->methodProfile; // factory
            $message = 'Profile \''.$name.'\' started';
        }
        $this->appendLog(
            __FUNCTION__,
            array(
                $message,
            ),
            $meta
        );
    }
Starts recording a performance profile

@param string $name Optional Profile name

@return void