Originally Posted by Kanegasi
Latency data is updated somewhere around every 30 seconds to a minute. An OnUpdate for that is completely unnecessary. I suggest registering a regular event to update latency, such as UNIT_AURA or COMBAT_LOG_EVENT_UNFILTERED. Make sure this event only calls for latency, doing more with these events is a potential performance hit in combat.
|
Using events to update something that isn't related to is generally a bad idea. There are a ton of issues that happen depending on which data you're trying to access or even trying to update your output in a timely manner. There is no single or group of events that is guaranteed to fire every X seconds in all situations.
A more direct alternative to using OnUpdate is the C_Timer lib.
C_Timer.NewTicker() wraps a function you give it and repeatedly calls
C_Timer.After(). See
SharedXML\C_TimerAugment.lua for Blizzard's implementation.