fpsMeter = () => {
const stats = new Stats();
stats.showPanel(0);
stats.dom.style.position = 'static';
let running = true;
requestAnimationFrame(function animate() {
stats.update();
if (running) {
requestAnimationFrame(animate);
}
});
invalidation.then(() => {
running = false;
});
return stats.dom;
}