Last active
June 26, 2017 03:37
-
-
Save zhjgithub/8dde80400b6af1000cd29b5089830c1b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Critical Path: Measure</title> | |
<meta name="viewport" content="width=device-width,initial-scale=1"> | |
<link href="style.css" rel="stylesheet"> | |
<script> | |
function measureCRP() { | |
var t = window.performance.timing, | |
interactive = t.domInteractive - t.domLoading, | |
dcl = t.domContentLoadedEventStart - t.domLoading, | |
complete = t.domComplete - t.domLoading; | |
var stats = document.createElement('p'); | |
stats.textContent = 'interactive: ' + interactive + 'ms, ' + 'dcl: ' + dcl + 'ms, complete: ' + complete + 'ms'; | |
document.body.appendChild(stats); | |
} | |
</script> | |
</head> | |
<body onload="measureCRP()"> | |
<p>Hello <span>web performance</span> students!</p> | |
<div><img src="awesome-photo.jpg"></div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment