You are here

public function StopwatchEvent::stop in Devel 8.2

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. 4.x webprofiler/src/Stopwatch.php \Drupal\webprofiler\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;
}