function Profile::getDuration
Returns the duration in microseconds.
File
-
vendor/
twig/ twig/ src/ Profiler/ Profile.php, line 87
Class
- Profile
- @author Fabien Potencier <fabien@symfony.com>
Namespace
Twig\ProfilerCode
public function getDuration() : float {
if ($this->isRoot() && $this->profiles) {
// for the root node with children, duration is the sum of all child durations
$duration = 0;
foreach ($this->profiles as $profile) {
$duration += $profile->getDuration();
}
return $duration;
}
return isset($this->ends['wt']) && isset($this->starts['wt']) ? $this->ends['wt'] - $this->starts['wt'] : 0;
}