So there is great stats.js and I need it to give me its current FPS value. How to do such thig?
So I try
stats.domElement.style.position = 'absolute';
stats.domElement.style.left = '0px';
stats.domElement.style.top = '0px';
$('body').append(stats.domElement );
setInterval( function () { stats.update();}, 1000 / 60 );
setInterval(function () { if(stats._fps <= 50){
// Do stuff for slow guys
}}, 1000 );
The Stats object only has two public properties:
domElementandupdate().To retrieve the FPS, you would have to add a
getFPSfunction to the object returned by the Status constructor, like this:That way, you can retrieve the FPS value using
stats.getFPS().