I have a script that pulls from an external database and stores the data in a local database. I’m setup on a shared-server environment so I’m not able to let the script run for longer than two minutes, yet it would take around 5-10 minutes to run to completion.
Can I have the script stop its foreach loop after one and a half minutes, so I can redirect to the same script but with a different database offset to pick up where it left?
I can do the last part of that using a GET query string, but I’m unsure how to time it.
The easiest way would be to set a time() at the start of your script and check the difference in your foreach loop.