Visualizing and monitor your performance.
Inspired by stats.js and memory-stats.js.
- Lite (vs pstats.js)
- Support GC detection when monitor memory (vs stats.js)
- Drawing fast (vs memory-stats.js)
npm install lstats.js
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'
}
});
MIT © 2017 Johnny Wu