SYNC

This command is used to improve the performance of demanding programs that require a consistent frame rate.

  Syntax
SYNC
  Returns

This command does not return a value.

  Description

This is especially true of games. By default, sync is set to off which allows the system to automatically handle screen refreshing. When SYNC ON is used, your program is responsible for handling screen refreshing. You can refresh the screen using the SYNC command. When you want the system to automatically handle screen refreshing again, you can use the SYNC OFF command. By placing the SYNC command at the end of your main program loop, all drawing and refresh tasks can occur in a single call. This dramatically increases the speed and smoothness of graphical operations, allowing your programs to run at their best. It is important to note the very first SYNC will only render the back buffer and reveal the contents of that buffer on the second SYNC command, as the system is based on a double buffered refresh.

  Example Code
SYNC ON
PRINT "only render this when "sync" used"
SYNC
SYNC OFF
PRINT "render this as soon as the command is called"
WAIT KEY
  See also

CORE Commands Menu
Index