public function stopAction(\Exception $exception = null)
    {
        $action = array_pop($this->actionStack);
        $this->lastActionIndex--;
        $action['time'] = microtime(true) - $action['time'] - $action['subtrahend'];
        if (null !== $exception) {
            $action['exception'] = $exception->getMessage();
        }
        unset($action['subtrahend']);
        $this->addSubtrahend($this->actionStack, $action['time']);
        $this->addSubtrahend($this->processorStack, $action['time']);
        $this->actions[] = $action;
        if (empty($this->actionStack) && $this->stopwatch) {
            $this->stopwatch->stop($this->getStopwatchName());
        }
    }