Animations on non-visible views

I have an app that displays an instrument dial that looks a bit like a speedometer or voltmeter with a circular face and a pointer. When operating, it updates perhaps once or twice a second, possibly more (it's triggered by data updates received by the network), using a CABasicAnimation as shown in the code below. But it's also quite possible that the dial is not visible to the user, for instance, if another tab view is active, or the dial is scrolled off-screen. What happens to animations on views/layers that aren't visible, do they just get discarded? I'm wondering if I should add a check of some sort in my code to minimize unnecessary performance hits. If so, how would I check if a UIView/CALayer is user-visible?

I'm assuming animations are "efficient" in the way I imagine but you know what they say about assuming...

func updateDialWithAnimation(degrees: CGFloat) {
    
    let radians = degrees * CGFloat.pi / 180
    let animation = CABasicAnimation()
    
    animation.keyPath = "transform.rotation.z"
    animation.fromValue = CGFloat(angle.value) * CGFloat.pi / 180
    animation.toValue = radians
    animation.duration = 0.33
    
    angleLabel.text = String(Float(degrees))
    angle.value = Float(degrees)
    
    // needle is a subclass of UIView
    needle.layer.add(animation, forKey: "basic")
    needle.layer.transform = CATransform3DMakeRotation(radians, 0, 0, 1)
}
Animations on non-visible views
 
 
Q