I'm trying to run an email validation script on a database of 500,000 emails. The problem is, when trying to connect to some of the domains, it takes too long to validate(I've seen it take more than 5 minutes) . I don't want to set a time limit for the entire script, but, I'd like to do something like each time it starts to check a new email address, set a time limit. Then, if that time limit is exceeded, write to the database that it timed out.
Any help would be greatly appreciated!