I am trying to create a game in wich there are 2 threads running constantly, one for the car controls and another one for determining the speed. The speed is calculated by comparing the car's current position to the position 0.1 seconds after (for wich I use time.sleep(0.1))
The thing is, I want the thread that determines the speed to start again only when is has finished, for this I use threadSpeed.isAlive(). But i think that when i use time.sleep, the thread shows up as not alive and so it starts generating many times, messing the program and throwing errors, so the question is: Is there a way to generate a delay without time.sleep? or is the problem totally unrelated? Thanks.