SecondBASIC Documentation v3

Home / Command Reference / Sleep

Sleep

Description: Pauses code execution for 1/60th of a second, or about 16.67 ms, for every <Unit> for NTSC consoles and 1/50th of a second for PAL consoles. 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.

Example:

    While 1
        a++
        Locate 1,1: Print a
        Sleep 20
    Wend