function StopwatchEvent::stop

Stops the last started event period.

Return value

StopwatchEvent The event

Throws

\LogicException When start wasn't called before stopping

\LogicException When stop() is called without a matching call to start()

1 call to StopwatchEvent::stop()
StopwatchEvent::ensureStopped in webprofiler/src/Stopwatch.php
Stops all non already stopped periods.

File

webprofiler/src/Stopwatch.php, line 365

Class

StopwatchEvent
Class StopwatchEvent

Namespace

Drupal\webprofiler

Code

public function stop() {
    if (!count($this->started)) {
        throw new \LogicException('stop() called but start() has not been called before.');
    }
    $this->periods[] = new StopwatchPeriod(array_pop($this->started), $this->getNow());
    return $this;
}