I'm making a reaction timer and it's working fine but if user presses enter before the sleep time is over code breaks.
import time
import random
from colorama import Fore
Random_Time = random.randint(10, 25)/10
x = input(Fore.YELLOW + "Press enter if you're ready. You'll be pressing enter when red lines appear. ")
if x == "":
time.sleep(Random_Time)
RightNow = time.time()
y = input(Fore.RED + f"-------------------\n-------------------\nNOW\n-------------------\n-------------------\n")
if y == "":
print(Fore.GREEN + f"Your Reaction time is: {time.time() - RightNow}")
When I press enter before the sleep time is over it prints a time around 0,005. I want to ignore the input until sleep time is over.