example: add fps panel

This commit is contained in:
Haowei Wen 2020-08-24 02:26:33 +08:00
parent 557f21e9c7
commit c21be7bcb5
No known key found for this signature in database
GPG Key ID: 5BC167F73EA558E4
1 changed files with 14 additions and 0 deletions

View File

@ -415,4 +415,18 @@
</body>
<script type="module" src="https://unpkg.com/stats.js@0.17.0/src/Stats.js" integrity="sha384-W71K+d2HbqXqQWSj3Vj4RDsIVvIV7lR8O6RArKAiqB39ntwLci0W08qOn4Z1n8sM" crossorigin="anonymous" async></script>
<script type="module" async>
import Stats from "https://unpkg.com/stats.js@0.17.0/src/Stats.js";
const stats = new Stats();
stats.dom.style.left = "";
stats.dom.style.right = "0";
document.body.appendChild(stats.dom);
function loop() {
stats.update();
requestAnimationFrame(loop)
}
requestAnimationFrame(loop);
</script>
</html>