Timer that uses requestAnimationFrame