In other words, using animations is excellent for repeating a function every X seconds, regardless of whether there are freezes in the wow client. I wonder if the animation function continues to fire as necessary during a loading screen (when zoning), while OnUpdates don't.
It's safe to assume that the animation system is less taxing on the CPU than calling a lua closure every frame, yeah.
That's interesting, I have never considered using Animations (which are rather new) to perform regular timed code (bucketing) before. Anyone interested in doing some tests on how much more efficient or inefficient it will be?
How do you create a delay inside a function without using OnUpdate and elapsed arg? If I wanted to create a function that sends a chat message every 5 seconds, do I need to use OnUpdate for it or is there any other way to do it?
If you do it any other way, you will hang WoW for 5 seconds as most of WoW's graphics system is single threaded.
Each time the screen is re-rendered (i.e. each Frame, in the FPS sense), the process runs as follows: