Create a CMD task that uses a small amount of cpu

Microsoft Windows
Post Reply
SweetTasha
Posts: 10
Joined: 2021-Sep-11, 4:24 am

Create a CMD task that uses a small amount of cpu

Post 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)
User avatar
Simon Sheppard
Posts: 190
Joined: 2021-Jul-10, 7:46 pm
Contact:

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

Post 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.
Post Reply