Tanktalus has offered a very sensible suggetion. In case you want to persue another alternative with the code you have, you could trigger & catch a $SIG{ALRM} via alarm after your $endtime seconds threshold has been met.
In reply to Re: Issue with time() in loop?
by vek
in thread Issue with time() in loop?
by Elijah
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |