Skip to content

Instantly share code, notes, and snippets.

@laphilosophia
Created October 30, 2017 10:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laphilosophia/3ae762eabff2bda026ee6c9c57a6c1c6 to your computer and use it in GitHub Desktop.
Save laphilosophia/3ae762eabff2bda026ee6c9c57a6c1c6 to your computer and use it in GitHub Desktop.
Performance Tips.
// Browser loading time
let calc = () => {
const domint = window.performance.timing.domInteractive;
const reqstr = window.performance.timing.requestStart;
return domint - reqstr;
}
// Resource timing
let perf = () => {
return window.performance.getEntriesByType('resource') || [];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment