-
Notifications
You must be signed in to change notification settings - Fork 82
clock
Steve Paget edited this page Feb 16, 2016
·
2 revisions
clock()
Note: The timer is reset to zero when pygame_functions is imported.
This can be used to ensure that a certain event happens at set intervals.
eg.
targetTime = 0
while True:
theTime = clock()
if theTime>targetTime:
targetTime = theTime + 2000
#this code should only happen every 2000 milliseconds