Is there a way to get the Process.TotalProcessorTime that reflects a process PLUS any processes that it has spawned?
Alternatively, how can I verify that the process (or it's descendants) are still "actively" running?
My app is spawning an external process and waiting for it to exit. With sample data it takes 5-20 minutes to complete; I don't have a guess for a reasonable maximum timeout. So my app checks the Process.TotalProcessorTime value on the other process at intervals, to ensure that it keeps rising.
This works fine, but I've discovered that the process is simply a "wrapper" that spawns a sub-process, which in turn spawns a handful of other sub-process that consume all of the CPU time.
And I've found that TotalProcessorTime returns only a small fraction of a second after several minutes of 100% CPU utilization.