Created
October 23, 2015 14:25
-
-
Save paulkaplan/7bf2f120023bc9711aa6 to your computer and use it in GitHub Desktop.
Customized stats.js bookmarklet
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
javascript:(function() { | |
var script = document.createElement('script'); | |
script.onload = function() { | |
/* Remove existing stats if it exists */ | |
var existingStatsElement = document.getElementById('stats'); | |
if (existingStatsElement) { | |
existingStatsElement.parentNode.removeChild(existingStatsElement); | |
} | |
var stats = new Stats(); | |
stats.setMode(1); /* Default to frame time mode */ | |
stats.domElement.style.cssText='position:fixed;left:0;top:0;z-index:10000'; | |
document.body.appendChild(stats.domElement); | |
requestAnimationFrame(function loop(){ | |
stats.update(); | |
requestAnimationFrame(loop); | |
}); | |
}; | |
script.src='//rawgit.com/mrdoob/stats.js/master/build/stats.min.js'; | |
document.head.appendChild(script); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment