No simple portable way. I've done this on both Unix and Windows and chose a different technique on each. Reading the responses to Threads or no Threads should prove useful: there are a couple of nice ideas from ikegami along with links to the Unix and Windows solutions I wrote.
In reply to Re: Timing out backquoted executions
by eyepopslikeamosquito
in thread Timing out backquoted executions
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |