Use requestAnimationFrame if available