last_call_time = -delay
while True:
    data = read_sensors()
command = process(data)
motor_try(command)

def motor_try(command):
    global last_call_time
current_time = time.clock()
elapsed = current_time - last_call_time
if elapsed >= delay:
    motor_do(command)
last_call_time = current_time
How to multithread/multiprocess just one instance of a particular function in Python?