Thread: Function timing
View Single Post
08-04-14, 11:51 PM   #5
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by SDPhantom View Post
I would think C_Timer.After() would be easier on resources since you won't have to create any UI objects to use. The only problem is you'll need to manage setting it up again if you want something to keep calling every so many seconds if you don't want to use Blizzard's Lua-defined Ticker factories (C_Timer.NewTicker() and C_Timer.NewTimer()). Note the Ticker factories return a table hooked into a metatable to control the ability to cancel a timer with entries for remaining iteration counts, a cancel flag, and a dynamicly-created callback function that is passed to C_Timer each iteration. This creates significantly more overhead than using C_Timer.After() yourself.
Basically, unless you need to cancel it or need something that keeps repeating, use C_Timer.After.
  Reply With Quote