1rest(3)                         Allegro manual                         rest(3)
2
3
4

NAME

6       rest  - Waits a specified number of milliseconds or yields CPU. Allegro
7       game programming library.
8

SYNOPSIS

10       #include <allegro.h>
11
12
13       void rest(unsigned int time);
14

DESCRIPTION

16       This function waits for the specified number of milliseconds.
17
18       Passing 0 as parameter will not wait, but just yield. This can be  use‐
19       ful  in  order  to  "play nice" with other processes. Other values will
20       cause CPU time to be dropped on most platforms. This will  look  better
21       to  users,  and  also  does things like saving battery power and making
22       fans less noisy.
23
24       Note that calling this inside your active game loop is a bad  idea,  as
25       you never know when the OS will give you the CPU back, so you could end
26       up missing the vertical retrace and skipping frames. On the other hand,
27       on  multitasking  operating  systems it is good form to give up the CPU
28       for a while if you will not be using it.
29
30

SEE ALSO

32       install_timer(3), rest_callback(3), vsync(3), d_yield_proc(3)
33
34
35
36Allegro                          version 4.4.3                         rest(3)
Impressum