Recipe 15.4

Finding Timings for a Specific Resource

Each resource performance entry has a name, which is its URL. You can use the getEntriesByName to find resource timings for a specific URL. This will return an array of resource entries with the given name.

Code

JavaScript
// Look up all requests to the /api/users API
const entries = window.performance
  .getEntriesByName('https://localhost/api/users', 'resource');
Web API Cookbook
Joe Attardi