The first implementation of processfamily

Hopefully it will work.
This will always wait 10 seconds.  Is there no way we can detect if the process is running or not (perhaps from pid) and cut down the amount of time we wait here, with a max of 10 seconds?