public function StopwatchEvent::getDuration in Devel 8
Same name and namespace in other branches
- 8.3 webprofiler/src/Stopwatch.php \Drupal\webprofiler\StopwatchEvent::getDuration()
- 8.2 webprofiler/src/Stopwatch.php \Drupal\webprofiler\StopwatchEvent::getDuration()
- 4.x webprofiler/src/Stopwatch.php \Drupal\webprofiler\StopwatchEvent::getDuration()
Gets the duration of the events (including all periods).
Return value
integer The duration (in milliseconds)
File
- webprofiler/
src/ Stopwatch.php, line 434
Class
- StopwatchEvent
- Class StopwatchEvent
Namespace
Drupal\webprofilerCode
public function getDuration() {
$total = 0;
foreach ($this->periods as $period) {
$total += $period
->getDuration();
}
return $total;
}