timing a loop in unix.

hi guys..
i have a shell script that loops through a certain directory to see if a file has been created and then prints the file if it exists...
the only problem i have now is that sometimes the flat does not get created by the program thats supposed to create it, in this scenario, my loop will never end.. is there a way i can check to say if the loop has been on for like 2 mins to break..

this is what i have so far..

if [[ -f ${data_dir}/sqrs0008.dat ]] then
exec < ${data_dir}/sqrs0008.dat
IFS=","
while read schedule_id username printer_name;
do
until [[ -f ${output_dir}/${db_user}.${schedule_id}.prn ]]
do
sleep 10
if [[ -f ${output_dir}/${db_user}.${schedule_id}.prn ]] then
lp -d${printer_name} -t$username ${output_dir}/${db_user}.${schedule_id}.prn
break
fi
done
done
fi
can anyone help out there, as i need an urgent fix to this ??

cheers guys

Simply put a counter and a sleep command - you will have to figure out how long to sleep and how high to count...
(Note - example from old csh script - modify to your shell is left to you)