Skip to content

Instantly share code, notes, and snippets.

@sunnyone
Created June 22, 2019 08:00
Show Gist options
  • Save sunnyone/9d86039faf434a421c9f4f5aa25d274d to your computer and use it in GitHub Desktop.
Save sunnyone/9d86039faf434a421c9f4f5aa25d274d to your computer and use it in GitHub Desktop.
performance trace
<html>
<head></head>
<body>
<script>
window.perf1start = performance.now();
</script>
<link rel="stylesheet" href="" />
<script>
var perf1 = performance.now() - window.perf1start;
var perf1h = document.createElement("h1");
perf1h.innerText = "IPv4: " + perf1 + "ms";
document.body.appendChild(perf1h);
</script>
<script>
window.perf2start = performance.now();
</script>
<link rel="stylesheet" href="" />
<script>
var perf2 = performance.now() - window.perf2start;
var perf2h = document.createElement("h1");
perf2h.innerText = "IPv6/IPv4: " + perf2 + "ms";
document.body.appendChild(perf2h);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment