im sending a shell command with php and well, the tar takes a while to complete so by the time my php script ends, it looks for a file which i had to untar but it fails because the untaring is not complete i tried to use sleep() to make php pause, but that doesnt work i don know what to do

what i want to do is php wait for exe() to complete tar

these are my goals:
php pause script seconds
php delay script
php sleep blank page
php wait for exe() to complete