Is there any module that exists that will stop the execution of a specific value in a loop if the time taken to compute reaches more than a specific amount of seconds?
For example, in the code:
for i in range(10):
print(socket.gethostbyname(entry[i]))
If it takes longer than 1 second to compute socket.gethostbyname(entry[i]), I want it to skip and go to the next one.
Thanks!