quote:
Richard, based on what you're saying using a doevents command in the script will not make the system run more efficiently?
Correct. In fact it (probably) forces a context switch, which make the machine run less efficiently.

quote:
I thought a system shouldn't be maxed out at 100%
100% is exactly what you want your system to run at - that is good use of resources. What's the point of buying a 2GH processor, and using the same processing cycles of a 1.5GH processor?

The same thing applies to memory. Unused memory is wasted memory and means your machine is running efficiently. Any memory not used by in-core processes should be used by the kernel for i/o buffering.

You probably only have one CPU, which means that you can only have a single task running at any one time. Each process gets a timeslice in which it can run after which it gets kicked off the CPU. Both the length of time it gets to run and the frequency that it gets a slot are determined by the scheduler based on a number of parameters, of which one is the priority.

An over-burdened machine is one where processes have to wait excessively long for a scheduled slot, and the degree that you are "out of CPU" is entirely down to how you feel the programs are responding, not the percentage of time that the CPU is busy.

Ignoring i/o issues, a program will always take exactly the same time to run. However that time will be split up, and the more programs it is sharing the CPU with, the more time it will appear to take.

Imagine you have a time machine, and you jump forward a year every birthday. Now after doing this 10 times, you will have aged 10 years, but everyone else will have aged 20. The 10 years is like the CPU time required to run a program, the 20 years is like the "real" time that has passed. Objective and subjective, if you prefer.

quote:
so you should consider even setting it to "/high"
quote:
That won't kill the cpu and make it run dog slow?
The CPU cannot run slow - it is governed by a clock and it runs at that speed. The subjective time that a program takes to run can lengthen when a CPU has a lot to do.

You can make inefficient use of the CPU, mainly by unnecessary i/o.

Setting the process priority to high will give it a longer slice of time on the CPU and/or more slices than normal priority processes. It won't take any more or less CPU however.

If this is a machine dedicated to the task then it is appropriate to give it a high priority, although I'd probably avoid the "realtime" priority otherwise some system processes may not get a look in making the system unstable.

If it is a general purpose machine then you will want to lower the priority because you want the interactive elements (keyboard, mouse clicks, screen updates) to have a higher priority than the batch task. This is because usually you don't care if it takes an additional 10 seconds to run, but you do care if your computer becomes unresponsive while it is running.

As an aside, your CPU is *always* 100% busy, but the spare CPU cycles are consumed by a process called "System Idle Process" in task manager.

This is quite a simplified overview, and is a reasonable description for small machines where the interaction between processes and hardware components is not too significant.