urns {Array.<!Endpoint>}
   */
  function getEndpoints_(events, startType, endType) {
    const endpoints = [];
    for (const event of events) {
      endpoints.push({
        time: event.start,
        type: startType
      });
      endpoints.push({
        time: event.end,
        type: endType
      });
    }

    return endpoints;
  }

  /**
   * Returns true if at time |timestamp| we have a long enough quiet window for
   * determining Time to Interactive.
   *
   * @param {number} timestamp - Timest