Wait till Specified Time
I need the best way to halt a program until the specified time is mentioned(in variable wait_time a tuple of hours, minutes, seconds). I had tried to use while loop for this. But is there a more efficient way for this such that it doesn't take much of the CPU. After waiting it does a function called solve().
wait_time=(12,10,15)
import time
time_str=time.localtime()
current_time=(time_str.tm_hour,time_str.tm_min,time_str,time_str.tm_sec)
while current_time!=wait_time:
current_time=(time_str.tm_hour,time_str.tm_min,time_str,time_str.tm_sec)
else:
print('Wait time over')
solve()
I require a more efficient way than this for the memory part. It should wait until the system time is the time given.