You are here

public function Stopwatch::lap in Devel 4.x

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

Stops then restarts an event.

Parameters

string $name: The event name.

Return value

\Symfony\Component\Stopwatch\StopwatchEvent A StopwatchEvent instance

File

webprofiler/src/Stopwatch.php, line 134

Class

Stopwatch
Class Stopwatch.

Namespace

Drupal\webprofiler

Code

public function lap($name) {
  return end($this->activeSections)
    ->stopEvent($name)
    ->start();
}