Sack Library Documentation
|
IMPORT_METHOD _32 AddTimerExx(_32 start, _32 frequency, TimerCallbackProc callback, PTRSZVAL user DBG_PASS); #define AddTimerEx( s,f,c,u ) AddTimerExx( (s),(f),(c),(u) DBG_SRC ) #define AddTimer( f, c, u ) AddTimerExx( (f), (f), (c), (u) DBG_SRC)
Parameters |
Description |
_32 start |
how long in milliseconds until the timer starts. Can be 0 and timer will fire at the next opportunity. |
_32 frequency |
how long the delay is between event invocations, in milliseconds. |
TimerCallbackProc callback |
user routine to call when the timer's delay expires. |
user |
user data to pass to the callback when it is invoked. |
a 32 bit ID that identifies the timer for this application.
Adds a new periodic timer. From now, until the timer is removed with RemoveTimer, it will call the timer procedure at the specified frequency of milliseconds. The delay until the first time the timer fires can be specified independant of frequency. If it is not specified, the first time the timer will get invoked is at +1 frequency from now.
First some setup valid for all timer creations...
you might want to save this for something like RescheduleTimer
_32 timer_id;
Create a simple timer, it will fire at 250 milliseconds from now, and again every 250 milliseconds from the time it starts.
timer_id = AddTimer( 250, TimerProc, 0 );
Create a timer that fires immediately, and 732 milliseconds after, passing some value 1234 as user data...
timer_id = AddTimerEx( 0, 732, TimerProc, 1234 );
Copyright (c) 2000+. All rights reserved.
|
What do you think about this topic? Send feedback!
|