public function Section::stopEvent in Devel 4.x
Same name and namespace in other branches
- 8.3 webprofiler/src/Stopwatch.php \Drupal\webprofiler\Section::stopEvent()
- 8 webprofiler/src/Stopwatch.php \Drupal\webprofiler\Section::stopEvent()
- 8.2 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\webprofilerCode
public function stopEvent($name) {
if (!isset($this->events[$name])) {
throw new \LogicException(sprintf('Event "%s" is not started.', $name));
}
return $this->events[$name]
->stop();
}