I have a list of objects of a particular class where each object has a unix time attribute. I would like to execute a function
class Car:
def __init__(self, id, time):
self.id = id
self.time = time
objct = [Car(i, time_unix[i]) for i in range(10)]
where time_unix is a list of unix times. I would like to create a new thread that will run 'in parallel' to this code where it checks the current time. If the current time is equal to one of the object's unix_time, a new function called drive will be invoked.
So I would like to have a thread that is on constant alert for invoking a drive function since I might have other cars coming in with their respective time to drive.