"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getRequestToResponseTime = getRequestToResponseTime;
exports.getResponseEndTime = getResponseEndTime;
var _isPerformanceApiAvailable = require("./is-performance-api-available");
function getResponseEndTime() {
  if (!(0, _isPerformanceApiAvailable.isPerformanceAPIAvailable)()) {
    return;
  }
  var nav = performance.getEntriesByType('navigation')[0];
  if (nav) {
    return nav.responseEnd;
  }
  return;
}
function getRequestToResponseTime() {
  if (!(0, _isPerformanceApiAvailable.isPerformanceAPIAvailable)()) {
    return;
  }
  var nav = performance.getEntriesByType('navigation')[0];
  if (nav) {
    return nav.responseEnd - nav.requestStart;
  }
  return;
}