WAIT (Command)

V1
is not a command in SmileBasic V1.

V2
is a command which takes one numerical parameter, which gets rounded down, and pauses the execution of the program.

Once every 1/60 of a second, i.e. once every frame, the physical displays are updated to reflect the current state of the display buffers. The  command will always end immediately after this update, unless the parameter is zero. (A negative parameter will generate an  error.)

When the parameter is zero,  takes very little time.

When the parameter is one,  will wait until the next 'tick' of the frame clock (unless, when the command is started, it is very close to a 'tick': parsing and processing the command may take the system to after that close tick, so that when the command starts executing it will wait for the next tick after that).

When the parameter is two,  will wait until the second tick (unless it starts very close to a tick, then it will wait for the third tick), etc..

One common usage of  is to reduce animation flicker. If clearing the screen and drawing the display takes less than one frame, then a  immediately before will ensure that the screens never display half-drawn images. Another usage is to slow down animations, or simply to pause the program so that e.g. there is time for a user to read a message displayed on the screen.

In summary,  takes a very little amount of time and may terminate at any phase relative to the frame clock, and   where   is positive will take between ( -1 frames plus a little) and (  frames plus a little), and will terminate just after a 'tick'.

V3
No information on SmileBasic V3.