Pause php script

Is it possible to pause a php script for a specific number of seconds and have it start again after that time.

What I am trying to do is retrieve a large number of results from a database and run a script for each result. Due to the large number of results, I would like to pause the script for say 30 seconds and then have it resume where it stopped.

Can this be done with php only?