I want to make a stopwatch for rubik's cube timing, where you press enter to start it and press spacebar to make it stop. Here is what I have so far:
import time
running = True
second = 0
minute = 0
mill = 0 #by the way this is for millisecond
while running:
print('Rubik\'s cube timer: press enter to start, space bar to stop')
print('Note: you won\'t be able to see the time until you end it')
input()
if mill == 100:
mill = 0
second += 1
if second == 60:
second = 0
minute += 1
time.sleep(.01)
mill += 1
But all that does is go on and on without ending. It is supposed to not stop the timer or show you ho w long it was until you press space bar. I don't know how to make it stop when space bar is pressed.
time.sleepare really unnecessary