I made a program to check the state of a key and writes a file based on the last time the key was pressed. I am doing to help me time events in a game. So both this program and the game will be running at the same time. The problem is this simple program strives to take up 100% of the processor time so this causes the game to run slowly. I am only checking the state of the key once every second. Is there a way to lower the programs priority or somehow tell it not to try so hard so the game won't suffer?