Timer in requestAnimationFrame. Source: https://developer.mozilla.org/en-US/docs/Web/API/window.requestAnimationFrame