Get a better host: you're going to be in trouble if you want a script to execute forever.
Or, if you don't mind the timing function being done on a different computer, just create a cron job somewhere else that requests the page the triggers the function. (Security for this arrangement is left as an exercise for the reader...)