it would be cool if php had some built-in timer functions where you could keep looping to check if a file has been detected until the specified time of the end of the loop.
something like this:
Code:
while($start_time < $end_time)
{
check for file; // but keep looping while still checking the file
if(file is found)
{
$end_time==$start_time;
}
}