Page 1 of 1

Create a CMD task that uses a small amount of cpu

Posted: 2023-Dec-31, 12:37 am
by SweetTasha
I'm troubleshooting a Windows task that is monopolizing cpu usage.

I want to create a CMD task that utilizes a small amount of cpu, say 1-5%, to observe whether it get's enough priority to execute while the high usage task is eating up most of the cpu cycles. I realize that my requirements are a bit imprecise. Perhaps a task that uses a small amount of cpu but periodically enters a wait state , then loops back to the beginning. In other words, does the Windows task have such a high priority that no other task gets a chance to run?

I've worked with CMD and VBA in EXCEL quite a bit in the past, not so much recently. I've tried Powershell but haven't succeeded in creating anything that actually runs :oops:

I hope that I've given enough information for forum users to respond.

Thanks,
SweetTasha (Phil)

Re: Create a CMD task that uses a small amount of cpu

Posted: 2023-Dec-31, 2:14 pm
by Simon Sheppard
You could just write a test script that counts up to 1 billion or something, analysing CPU usage in real time can be quite hard to do accurately as every action you take will itself affect CPU.

High CPU usage often just means that your CPU is being used optimally, the faster a task can complete, the sooner it can exit to free up the CPU for something else.