timer = any valid timer handle |
This command will halt execution until the timer generates the next tick event, unless an unprocessed tick event is outstanding, in which case execution continues immediately.
Use this in conjunction with the CreateTimer command. This is useful to control the execution speed of your program. It will wait until a timer tick event is received, or, if there are outstanding timer tick events, it will return the number of timer tick events that have passed since last being called. This command should not be used in GUI based applications, as any other events that may occur before the timer event will go missing. Instead, GUI based applications should use WaitEvent to monitor timers. You should never use both WaitEvent and WaitTimer at the same timer, as you may 'lose' timer tick events. WaitTimer can not be used with a paused timer. See also: CreateTimer, WaitEvent. |
; Create the timer to track speed
frameTimer=CreateTimer(60) ; Your main screen draw loop While Not KeyHit(1) WaitTimer(frameTimer) ; Pause until the timer reaches 60 Cls ; Draw your screen stuff Flip Wend |