You are here

public function StopwatchEvent::stop in Devel 4.x

Same name and namespace in other branches
  1. 8.3 webprofiler/src/Stopwatch.php \Drupal\webprofiler\StopwatchEvent::stop()
  2. 8 webprofiler/src/Stopwatch.php \Drupal\webprofiler\StopwatchEvent::stop()
  3. 8.2 webprofiler/src/Stopwatch.php \Drupal\webprofiler\StopwatchEvent::stop()

Stops the last started event period.

Return value

\Symfony\Component\Stopwatch\StopwatchEvent The event.

Throws

\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 412

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;
}