Simple function throttling with requestAnimationFrame