in reply to Process time out

I would fork the program. Have the child do your tasks and have the parent sleep. After 10 min. you can have the parent kill the child (since you have the pid).