Skip to content

uupaa/Perf.js

Repository files navigation

Perf.js Build Status

npm

Performance monitor.

Document

Features

  • Monitoring fps and ms.

Browser and NW.js(node-webkit)

<script src="<module-dir>/lib/WebModule.js"></script>
<script src="<module-dir>/node_modules/uupaa.pagevisibilityevent.js/lib/PageVisibilityEvent.js"></script>
<script src="<module-dir>/node_modules/uupaa.clock.js/lib/Clock.js"></script>
<script src="<module-dir>/lib/Perf.js"></script>
<script>
var options = { parentNode: document.body, x: 100, y: 100, opacity: 0.7 };
var perf = new Perf(options);


function gameLoop() {
    perf.a;
    {
        // --- performance monitor block ---
        // userInput();
        // enemyMove();
        // redraw();
    }
    perf.b;

    requestAnimationFrame(gameLoop);
}

requestAnimationFrame(gameLoop);
</script>

About

Performance monitor

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published