You are here

public function TimeDataCollector::getDuration in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-kernel/DataCollector/TimeDataCollector.php \Symfony\Component\HttpKernel\DataCollector\TimeDataCollector::getDuration()

Gets the request elapsed time.

Return value

float The elapsed time

File

vendor/symfony/http-kernel/DataCollector/TimeDataCollector.php, line 92

Class

TimeDataCollector
TimeDataCollector.

Namespace

Symfony\Component\HttpKernel\DataCollector

Code

public function getDuration() {
  if (!isset($this->data['events']['__section__'])) {
    return 0;
  }
  $lastEvent = $this->data['events']['__section__'];
  return $lastEvent
    ->getOrigin() + $lastEvent
    ->getDuration() - $this
    ->getStartTime();
}