`requestAnimationFrame`


```type// Function that returns a Promise for the FPSconst getFPS = () =>  new Promise(resolve =>    requestAnimationFrame(t1 =>      requestAnimationFrame(t2 => resolve(1000 / (t2 - t1)))    )  )// Calling the function to get the FPSgetFPS().then(fps => console.log(fps));```




> [window.requestAnimationFrame() - Web API | MDN](https://developer.mozilla.org/ko/docs/Web/API/Window/requestAnimationFrame)

> [Is it possible to find out what is the monitor frame rate in javascript?](https://stackoverflow.com/questions/6131051/is-it-possible-to-find-out-what-is-the-monitor-frame-rate-in-javascript/44013686)






