1. 7

  2. 1

    I suggest rather than putting all this frame-related logic into your event handlers, attach it to the calculation you’re scheduling. Have you handlers talk to the object that needs to recalculate things by call an invalidate() method, which can be called whenever, and the object itself maintains the timer / RAF.