Initial Commit
This commit is contained in:
27
TESTING/Time.py
Normal file
27
TESTING/Time.py
Normal file
@@ -0,0 +1,27 @@
|
||||
import pygame
|
||||
from icecream import ic
|
||||
from time import sleep
|
||||
|
||||
|
||||
CLOCK = pygame.time.Clock()
|
||||
|
||||
testOn = True
|
||||
timeStart = pygame.time.get_ticks()
|
||||
|
||||
while testOn: # Pretend game loop.
|
||||
if ic(pygame.time.get_ticks() - timeStart) >= 2000: # Once 2000 ms has elapsed.
|
||||
ic("Time has elapsed.")
|
||||
testOn = False
|
||||
|
||||
del testOn, timeStart
|
||||
|
||||
# ---------------------------------------------------------
|
||||
sleep(2)
|
||||
# ---------------------------------------------------------
|
||||
|
||||
timeStart = pygame.time.get_ticks()
|
||||
|
||||
while ic(pygame.time.get_ticks() - timeStart) < 2000:
|
||||
pass
|
||||
|
||||
ic("Time has elapsed.")
|
||||
Reference in New Issue
Block a user