import pygame import sys pygame.init() screen = pygame.display.set_mode ((800, 600)) clock = pygame.time.Clock() current_time = 0 button_press_time = 0 while True: for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit() sys.exit() if event.type == pygame. KEYDOWN: screen.fill((255,255,255)) button_press_time - pygame.time.get_ticks() current_time = pygame.time.get_ticks() print(f"Current time: {current_time},\ Button press time: {button_press_time}") if current_time button_press_time > 2000: print("2 seconds have passed") pygame.display.flip() clock.tick(60)