This repository has been archived on 2025-07-12. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
shroom_of_doom/TESTING/Time.py
2025-02-26 14:40:25 -05:00

27 lines
645 B
Python

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.")