Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
api:event [2017/06/11 02:35]
payonel
api:event [2017/06/11 02:37]
payonel
Line 34: Line 34:
 **Returns:​** a timer ID that can be used to cancel the timer at any time.\\ **Returns:​** a timer ID that can be used to cancel the timer at any time.\\
 //Note//: the timer resolution can vary. If the computer is idle and enters sleep mode, it will only be woken in a game tick, so the time the callback is called may be up to 0.05 seconds off.  ​ //Note//: the timer resolution can vary. If the computer is idle and enters sleep mode, it will only be woken in a game tick, so the time the callback is called may be up to 0.05 seconds off.  ​
-**Important**:​ timers are driven by the `event.pull` function. If you always pull signals directly from `os.pullSignal` and never call `event.pull`,​ timers will not work! 
 - `event.cancel(timerId:​ number): boolean`  ​ - `event.cancel(timerId:​ number): boolean`  ​
 Cancels a timer previously created with `event.timer`.  ​ Cancels a timer previously created with `event.timer`.  ​