@remvst/client-performance
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

performance-recorder

Usage

const recorder = new PerformanceRecorder({
    recordCount: window.innerWidth / 2,
});

const renderer = new PerformanceRenderer(recorder, [
    { color: 'yellow', renderer: renderExecutionTime('gameUpdate') },
    { color: 'blue', renderer: renderExecutionTime('render') },
    { color: 'red', renderer: renderFramerate('frame') },
], 2);

function onFrame() {
    recorder.wrap('frame', () => {
        recorder.wrap('gameUpdate', gameUpdate);
        recorder.wrap('render', render);
    });

    recorder.roll();
    renderer.update();
}

Readme

Keywords

none

Package Sidebar

Install

npm i @remvst/client-performance

Weekly Downloads

0

Version

1.0.0

License

UNLICENSED

Unpacked Size

12.6 kB

Total Files

21

Last publish

Collaborators

  • remvst