lstats.js

1.2.7 • Public • Published

lstats.js

Visualizing and monitor your performance.

Inspired by stats.js and memory-stats.js.

mb fps ms

Why

  • Lite (vs pstats.js)
  • Support GC detection when monitor memory (vs stats.js)
  • Drawing fast (vs memory-stats.js)

Install

npm install lstats.js

Usage

let stats = new LStats(document.body, [
  'fps', 'ms', 'mem'
]);

function render() {
  stats.tick();
  requestAnimationFrame(render);
}

render();

NOTE: if you want to monitor memory, start Chrome with --enable-precise-memory-info. Otherwise the results from performance.memory are bucketed and less useful. if you are using Electron, start the BrowserWindow with the following code:

let win = new BrowserWindow({
  webPreferences: {
    blinkFeatures: 'PreciseMemoryInfo'
  }
});

License

MIT © 2017 Johnny Wu

Readme

Keywords

Package Sidebar

Install

npm i lstats.js

Weekly Downloads

3

Version

1.2.7

License

MIT

Last publish

Collaborators

  • johnnywu