pygame documentation
||
Home
||
Help Contents
||
||
CD
||
Channel
||
Font
||
Joystick
||
Movie
||
Rect
||
Sound
||
||
Surface
||
pygame
||
UserRect
||
cdrom
||
constants
||
cursors
||
display
||
||
draw
||
event
||
font
||
image
||
joystick
||
key
||
mixer
||
||
mixer_music
||
mouse
||
movie
||
surfarray
||
time
||
transform
||
version
||
pygame.time
Contains routines to help keep track of time. The timer resolution on most systems is around 10ms.
All times are represented in milliseconds, which is simply Seconds*1000. (therefore 2500 milliseconds is 2.5 seconds)
delay
- delay for a number of milliseconds
get_ticks
- milliseconds since startup
set_timer
- control timer events
delay
pygame.time.delay(millseconds) -> none
Will pause for a given number of milliseconds.
get_ticks
pygame.time.get_ticks() -> int
This is the time in milliseconds since the pygame.time was imported.
set_timer
pygame.time.set_timer(eventid, milliseconds) -> int
Every event id can have a timer attached to it. Calling this will set the timer in milliseconds for that event. setting milliseconds to 0 or less will disable that timer. When a timer for an event is set, that event will be placed on the event queue every given number of milliseconds.