Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Profile.php

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\Profiler

Code

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;
}
RSS feed
Powered by Drupal