You are here

public function StopwatchEvent::getDuration in Devel 8.3

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

Gets the duration of the events (including all periods).

Return value

int The duration (in milliseconds).

File

webprofiler/src/Stopwatch.php, line 487

Class

StopwatchEvent
Class StopwatchEvent.

Namespace

Drupal\webprofiler

Code

public function getDuration() {
  $total = 0;
  foreach ($this->periods as $period) {
    $total += $period
      ->getDuration();
  }
  return $total;
}