Thread Tools Display Modes
Prev Previous Post   Next Post Next
07-26-18, 02:46 PM   #1
pcg79
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Jul 2018
Posts: 7
[Solved] CTimer.After first trigger is too fast

I've been playing with AceTimer in my app and I saw some weird behavior where the very first timer trigger happens between 3 and 5 seconds too fast. I figured it was my code or AceTimer so I removed everything from my app's OnInitialize and OnEnable functions and then set my code to use CTimer.After directly (which is what AceTimer uses under the covers). So my app now has this:

Code:
local delay = 10

function CTimerFire()
    print("[ " .. date("%X") .. " ] CTimerFired")

    C_Timer.After(delay, CTimerFire)
end

function TestApp:OnEnable()
    C_Timer.After(delay, CTimerFire)

    local nextFire = time() + delay
    print("[ " .. date("%X") .. " ] It should fire in " .. delay .. " seconds (" .. nextFire .. " aka " .. date("%X", nextFire ) .. ")")
end
And I'm still seeing the same thing. Not once has the first event triggered at the correct time. All subsequent events fire at the correct time, though. I've tried with delays as short as 1 second and as long as 120 seconds. I'm wondering if anyone else has seen this or might know what I'm doing wrong or misunderstanding about addons.

https://imgur.com/a/YQKdlmA

Last edited by pcg79 : 08-05-18 at 05:35 AM.
  Reply With Quote
 

WoWInterface » Developer Discussions » General Authoring Discussion » CTimer.After first trigger is too fast

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off