public function StopwatchEvent::getDuration in Devel 4.x
Same name and namespace in other branches
- 8.3 webprofiler/src/Stopwatch.php \Drupal\webprofiler\StopwatchEvent::getDuration()
- 8 webprofiler/src/Stopwatch.php \Drupal\webprofiler\StopwatchEvent::getDuration()
- 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\webprofilerCode
public function getDuration() {
$total = 0;
foreach ($this->periods as $period) {
$total += $period
->getDuration();
}
return $total;
}