adding requestAnimationFrame to Timer