uupaa.perf.js

0.0.7 • Public • Published

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>

Package Sidebar

Install

npm i uupaa.perf.js

Weekly Downloads

0

Version

0.0.7

License

MIT

Last publish

Collaborators

  • uupaa