You are here

public function PerformanceTimingData::getTtfbTiming in Devel 4.x

Same name and namespace in other branches
  1. 8.3 webprofiler/src/Frontend/PerformanceTimingData.php \Drupal\webprofiler\Frontend\PerformanceTimingData::getTtfbTiming()
  2. 8 webprofiler/src/Frontend/PerformanceTimingData.php \Drupal\webprofiler\Frontend\PerformanceTimingData::getTtfbTiming()
  3. 8.2 webprofiler/src/Frontend/PerformanceTimingData.php \Drupal\webprofiler\Frontend\PerformanceTimingData::getTtfbTiming()

Return value

int

File

webprofiler/src/Frontend/PerformanceTimingData.php, line 49

Class

PerformanceTimingData
Class PerformanceTimingData.

Namespace

Drupal\webprofiler\Frontend

Code

public function getTtfbTiming() {
  if (isset($this->data['responseStart']) && isset($this->data['connectEnd'])) {
    return $this->data['responseStart'] - $this->data['connectEnd'];
  }
  else {
    return 0;
  }
}