In the workplace I was at in the Winter there was a `timeout` script that I could use, but it was custom-made Shell and/or Python. It was pretty complicated, for cases when a process would spawn many children that would also need to be killed. So I'd say your best bet is a simple script along the lines of what Khalid suggested.