I have code that can potentially have an endless loop. I would like to be able to stop this in code, is there somethng that can do that? Some thing like:
for i to range(0,5):
timer = on
run(x)
#while run is running
if timer.time > 30:
exit run(x)
print("out of time ")
print(timer.time)
So the output could be: 3, 2, out of time 30, 2, out of time 30
I'm afraid this might require threading, which I have attempted in C and Java, for school, but never python.