run a mehod in a loop for a specific time python code example
Example: how to make a while loop run for 5 seconds
import time
t_end = time.time() + 60 * 15
while time.time() < t_end:
import time
t_end = time.time() + 60 * 15
while time.time() < t_end: