You are here

public function StopwatchEvent::getDuration in Devel 4.x

Same name and namespace in other branches
  1. 8.3 webprofiler/src/Stopwatch.php \Drupal\webprofiler\StopwatchEvent::getDuration()
  2. 8 webprofiler/src/Stopwatch.php \Drupal\webprofiler\StopwatchEvent::getDuration()
  3. 8.2 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;
}