I am launching an external program through perl on Windows. Most of the time, everything goes well. But sometimes, the program decides to throw up a click-through error message. I don't want to babysit the script - if the program hangs, kill it and return an error. I could timeout the process, but there is no good way to know how long it will take - it varies on a case by case basis. So I thought maybe I could check every so often and see how much CPU resources the process is using... then if it stops using the CPU for a while, kill it. Is there a way to check CPU resources based on a process ID? Or maybe there is a better way to do this?
Thanks in advance, Laura
In reply to Kill a process if it hangs by trala
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |