What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » WLM Plus! Bug Reports » Timer bug ?

Timer bug ?
Author: Message:
OcuS
New Member
*

Avatar


Posts: 11
– / Male / –
Joined: Jul 2006
O.P. Timer bug ?
Here is the code to Add Timers :

code:
function OnEvent_Initialize(MessengerStart) {
        AddTimers(1);
}

function AddTimers(Mult) {
        var Elapse, TimerId;
        for (var i = 1 ; i <= 10 ; i++) {
                Elapse = 100 + (i * Mult);
                TimerId = 'Timer_Mult:' + Mult + '_' + i + '_Elapse:' + Elapse;
                MsgPlus.AddTimer(TimerId, Elapse);
                Debug.Trace('<-- Timer added : ' + TimerId);
        }
}

function OnEvent_Timer(TimerId) {
        Debug.Trace('--> Timer catched : ' + TimerId);
}



Tested on my computer, with AddTimers() argument lower than 20 (in most cases) (works for > 20).
This should give (notice the catch order) :
code:
<-- Timer added : Timer_Mult:1_1_Elapse:101
<-- Timer added : Timer_Mult:1_2_Elapse:102
<-- Timer added : Timer_Mult:1_3_Elapse:103
<-- Timer added : Timer_Mult:1_4_Elapse:104
<-- Timer added : Timer_Mult:1_5_Elapse:105
<-- Timer added : Timer_Mult:1_6_Elapse:106
<-- Timer added : Timer_Mult:1_7_Elapse:107
<-- Timer added : Timer_Mult:1_8_Elapse:108
<-- Timer added : Timer_Mult:1_9_Elapse:109
<-- Timer added : Timer_Mult:1_10_Elapse:110
--> Timer catched : Timer_Mult:1_1_Elapse:101
--> Timer catched : Timer_Mult:1_2_Elapse:102
--> Timer catched : Timer_Mult:1_3_Elapse:103
--> Timer catched : Timer_Mult:1_4_Elapse:104
--> Timer catched : Timer_Mult:1_5_Elapse:105
--> Timer catched : Timer_Mult:1_6_Elapse:106
--> Timer catched : Timer_Mult:1_7_Elapse:107
--> Timer catched : Timer_Mult:1_8_Elapse:108
--> Timer catched : Timer_Mult:1_9_Elapse:109
--> Timer catched : Timer_Mult:1_10_Elapse:110


but it give :
code:
<-- Timer added : Timer_Mult:1_1_Elapse:101
<-- Timer added : Timer_Mult:1_2_Elapse:102
<-- Timer added : Timer_Mult:1_3_Elapse:103
<-- Timer added : Timer_Mult:1_4_Elapse:104
<-- Timer added : Timer_Mult:1_5_Elapse:105
<-- Timer added : Timer_Mult:1_6_Elapse:106
<-- Timer added : Timer_Mult:1_7_Elapse:107
<-- Timer added : Timer_Mult:1_8_Elapse:108
<-- Timer added : Timer_Mult:1_9_Elapse:109
<-- Timer added : Timer_Mult:1_10_Elapse:110
--> Timer catched : Timer_Mult:1_9_Elapse:109
--> Timer catched : Timer_Mult:1_8_Elapse:108
--> Timer catched : Timer_Mult:1_7_Elapse:107
--> Timer catched : Timer_Mult:1_6_Elapse:106
--> Timer catched : Timer_Mult:1_5_Elapse:105
--> Timer catched : Timer_Mult:1_4_Elapse:104
--> Timer catched : Timer_Mult:1_3_Elapse:103
--> Timer catched : Timer_Mult:1_2_Elapse:102
--> Timer catched : Timer_Mult:1_1_Elapse:101
--> Timer catched : Timer_Mult:1_10_Elapse:110


They appeared in a random order...
                                    Another french user
[Image: ocus-banner.gif]
[Bugs found: 1]
07-19-2006 04:22 PM
Profile E-Mail PM Find Quote Report
Patchou
Messenger Plus! Creator
*****

Avatar

Posts: 8607
Reputation: 201
43 / Male / Flag
Joined: Apr 2002
RE: Timer bug ?
There is no guarented order for timers. The resolution is about 10ms so there's bound to be problems like the one you point out. You jsut can't expect two timers created one after the other with the same value to be fired in order, they have the same timeout value after all :).
[Image: signature2.gif]
07-19-2006 06:56 PM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On