Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /mnt/web218/a3/28/510129628/htdocs/config.php on line 36 Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /mnt/web218/a3/28/510129628/htdocs/config.php on line 37 Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /mnt/web218/a3/28/510129628/htdocs/lang.php on line 55 Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /mnt/web218/a3/28/510129628/htdocs/lang.php on line 55 Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /mnt/web218/a3/28/510129628/htdocs/lang.php on line 110 Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /mnt/web218/a3/28/510129628/htdocs/lang.php on line 110 Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /mnt/web218/a3/28/510129628/htdocs/border_html5.php on line 201 Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /mnt/web218/a3/28/510129628/htdocs/border_html5.php on line 201 Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /mnt/web218/a3/28/510129628/htdocs/border_html5.php on line 216 Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /mnt/web218/a3/28/510129628/htdocs/border_html5.php on line 216 Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /mnt/web218/a3/28/510129628/htdocs/border_html5.php on line 231 Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /mnt/web218/a3/28/510129628/htdocs/border_html5.php on line 232 Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /mnt/web218/a3/28/510129628/htdocs/border_html5.php on line 232 Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /mnt/web218/a3/28/510129628/htdocs/border_html5.php on line 233 Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /mnt/web218/a3/28/510129628/htdocs/border_html5.php on line 233 GLBasic User Manual

GLBasic User Manual

Main sections

HIBERNATE

HIBERNATE



The HIBERNATE command puts the program into a sleep mode until the user does something (moves the mouse, presses a key, touches the joystick, ...)
With this command CPU load can be reduced drastically . If you're writing a level editor for example where you don't have to update the display every frame for animations, putting a HIBERNATE command in your code will allow other programs to use the CPU while no work is required by your program.
Using this command offers laptops and pocketpc devices a longer battery lifetime.

// --------------------------------- //
// Project: Hibernate
// Start: Tuesday, May 04, 2004
// IDE Version: 1.40430
WHILE TRUE
    a$=""
    FOR i=0 TO 255
        IF KEY(i) THEN a$=a$+i+", "
    NEXT
    MOUSESTATE mx, my, b1, b2
    JOYSTATE jx,jy,jb1,jb2
    PRINT a$, 0,0
    PRINT "Mx:"+mx+" My:"+my+" b1:"+b1+" b2:"+b2, 0,40
    PRINT "Jx:"+jx+" Jy:"+jy+" b1:"+jb1+" b2:"+jb2, 0,80
    SHOWSCREEN
    HIBERNATE
WEND

See also...