You are here

public function Section::stopEvent in Devel 8.3

Same name and namespace in other branches
  1. 8 webprofiler/src/Stopwatch.php \Drupal\webprofiler\Section::stopEvent()
  2. 8.2 webprofiler/src/Stopwatch.php \Drupal\webprofiler\Section::stopEvent()
  3. 4.x webprofiler/src/Stopwatch.php \Drupal\webprofiler\Section::stopEvent()

Stops an event.

Parameters

string $name: The event name.

Return value

\Symfony\Component\Stopwatch\StopwatchEvent The event.

Throws

\LogicException When the event has not been started.

File

webprofiler/src/Stopwatch.php, line 295

Class

Section
@internal This class is for internal usage only

Namespace

Drupal\webprofiler

Code

public function stopEvent($name) {
  if (!isset($this->events[$name])) {
    throw new \LogicException(sprintf('Event "%s" is not started.', $name));
  }
  return $this->events[$name]
    ->stop();
}