Sleep
Previous  Next

Description: Pauses code execution for 1/60th of a second, or about 16.67 ms, for every <Unit>. If the TvBlank option is used, the Sleep command ends at the beginning of the vertical blank, and if the TvBlank option is omitted, the Sleep command will end at the beginning of the displaying period.

     Syntax:
     
Sleep <Unit> [, TvBlank]

Part
Description
<Unit>
Required. The interval to pause execution by
TvBlank
Optional. Changes the period when the Sleep command ends.

Notes: The TvBlank option is great if you're loading tiles to VRAM after the Sleep command as they will load faster since the VDP should be idle at this time.

Example:

     Print "Hello"
     Sleep 60
     Print "World"
     Sleep 1, TvBlank
     LoadTiles MyTiles,1,1000
     End

MyTiles:
     DataFile mytile.bin, Bin