I have an application that has an intense startup phase, with CPU usage >50%. The length of this initial phase is unpredictable and varies between a few seconds to about a minute. Once the startup phase is over, the CPU usage for this app drops to 0%. I'd like to execute a command when the startup phase ends. To do this, I want to write a loop that checks the CPU usage of that process every second or so. I tried TCC's tasklist, but it doesn't give me the CPU usage per process. The closest thing I've found is pmon, part of Microsoft's Support Tools. Pmon shows CPU usage per process, but it displays the info on-screen in a continuously updated table, without terminating.
My questions: 1) Is there a way to extract info from commands like pmon, which continuously update their output? 2) If not, is there a another tool/command/technique that can check the CPU usage of a process?
My questions: 1) Is there a way to extract info from commands like pmon, which continuously update their output? 2) If not, is there a another tool/command/technique that can check the CPU usage of a process?