Skip to content

Instantly share code, notes, and snippets.

@Sc4ramouche
Created April 25, 2024 15:39
Show Gist options
  • Save Sc4ramouche/e4d5c7851099d69d699f0e406323d16e to your computer and use it in GitHub Desktop.
Save Sc4ramouche/e4d5c7851099d69d699f0e406323d16e to your computer and use it in GitHub Desktop.
let start = performance
.getEntriesByType('mark')
.find(m => m.name === 'dex-load-start');
let end = performance
.getEntriesByType('mark')
.find(m => m.name === 'dex-load-end');
let duration = Math.round(end?.startTime - start?.startTime);
console.log('dex-load:', duration)
@Sc4ramouche
Copy link
Author

If NaN is logged, it means that not both marks have been set yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment