in reply to Timing External Program Execution

You might want to take a look at the alert() function, which takes a number of seconds as an argument, such as alert(5). If five seconds was exceeded, an ALERT signal would be generated, which you would catch, and then you could kill the pid based on this.