import sys import pygame pygame.init() #starts the timer screen = pygame.display.set_mode((800,800)) #pygame window dimensions = 800*800 clock = pygame.time.Clock() #initiates pygame clock while True: #makes a loop for this event for event in pygame.event.get(): #registers mouse clicks or any inputs during loops if event.type == pygame.QUIT: #window close check pygame.quit() #shuts pygame down properly sys.exit() #exit Python if event.type == pygame.KEYDOWN: #REGISTERS DOWN ARROW ON KEYBOARD button_press_time = pygame.time.get_ticks() screen.fill((255,255,255)) current_time = pygame.time.get_ticks() if current_time == button_press_time > 2000: screen.fill((0,0,0)) print(f"current time: {current_time} button press time: {button_press_time}") pygame.display.flip() #visual changes update clock.tick(60) #game fps lock