Lore archive · Warcraft Wiki, 2023 dump
API C Timer.NewTimer
Last wiki revision 2023-11-06
Schedules a (repeating) timer that can be canceled. cbObject = C_Timer.NewTimer (seconds, callback) = C_Timer.NewTicker(seconds, callback [, iterations])
- seconds: - Time in seconds between each iteration.
- callback: - Callback function to run.
- iterations: - Number of times to repeat, or indefinite if omitted.
- cbObject: : FunctionContainer - Timer handle with and methods.
- The callback function will be supplied a view of the timer handle when invoked.
- The handle returned from the function and the one supplied to the callback are distinct objects that both reference a shared state. See the examples for more details.
- C_Timer.NewTimer has just a single iteration and is essentially the same as
- Errors thrown inside a callback function will not halt the ticker.
Schedules a repeating timer which runs 4 times.
Schedules a timer but cancels it right away.
Schedules a timer that prints a value written to a field stored on the timer handle itself. Timer handles all reference the same shared state internally, so user-defined fields written to handles can be used to supply additional data for use by the callback.
Schedules a repeating timer which runs 4 times and prints the timer handle returned from the function and supplied to the callback. Note that each print will result in a different object address being displayed, indicating the timer handles have a distinct identity.
- AceTimer-3.0
- OnUpdate
Source
https://warcraft.wiki.gg/wiki/API_C_Timer.NewTimer · retrieved 2023-11-13 · CC BY-SA 4.0
Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.
This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.