<s>[INST] import pygame
import sys

pygame.init()

screen = pygame.display.set_mode((800, 600))
clock = pygame.time.Clock()

for x in range(1000):
    screen.fill((255, 0, 0))  # Fill in the screen with color
    pygame.display.update()
    clock.tick(60)
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            pygame.quit()
            sys.exit()

    pos = pygame.mouse.get_pos()
    font = pygame.font.Font(None, 72)
    text = font.render("Hello, I am at ({}, {})".format(pos[0], pos[1]), True, (255, 255, 255))
    screen.blit(text, ((800 - text.get_width()) / 2, (600 - text.get_height()) / 2))
    pygame.display.update()

print('Done')

The code is just supposed to show the screen and a moving text with the coordinates of the user's mouse. But the problem is that the code appears to bring my whole computer to a standstill for a few seconds, or even crashes it completely. 

What can I do to fix this?[/INST]