Last active
September 23, 2019 14:10
-
-
Save shisama/c6fd101528e6573670c8ff876bea6f2e 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
<!doctype html> | |
<html> | |
<head> | |
</head> | |
<body> | |
<div id="info"></div> | |
<script> | |
const markerNameA = "example-marker-a" | |
const markerNameB = "example-marker-b" | |
// いくつかのネストしたタイムアウトを実行し、それぞれに対して PerformanceMark を作成します。 | |
performance.mark(markerNameA); | |
const c = performance.now(); | |
setTimeout(function() { | |
performance.mark(markerNameB); | |
setTimeout(function() { | |
const d = performance.now(); | |
// using User Timing API. check devTools Perfomarnce tab | |
performance.measure("measure a to b", markerNameA, markerNameB); | |
// print console tab | |
console.log(`measure c to d ${d - c}`); | |
performance.clearMarks(); | |
performance.clearMeasures(); | |
}, 1000); | |
}, 1000); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment