AmsTimer
Returned by server.after(). A timer schedules a callable without blocking the current event, and avoids executing the callback after the server stops or its amscript runtime reloads
Methods
Section titled “Methods”timer.cancel()
Section titled “timer.cancel()”Ends the timer and does not execute function
Attributes
Section titled “Attributes”| Attribute | Type | Description |
|---|---|---|
timer.delay | int / float | Delay in seconds |
timer.function | callable | Scheduled callable |
timer.arguments | dict | Positional and keyword arguments passed to the callable |
Examples
Section titled “Examples”timer = server.after(10, server.log, 'Hello from the future!')# Cancel before execution if no longer neededtimer.cancel()