There is nothing wrong with high CPU usage. After all, I hope your application really has some work to do, not just fooling around with CPU cycles, as some "developers" do. If you have no problem with OS and application functionality, is your concern that you look at CPU usage in Task Manager, which makes your feeling bad? Well, in this case, just don't look at it. :-) Instead, keep reading this post.
First thing to understand is: you are working with preemptive multitasking (multithreading) system; it generally "knows" pretty well when to preempt your thread and switch it out. Even though this mechanism may be not perfect, at least at the moderate workload and not in case of extremely scarce resources, it does a reasonably good work of keeping all applications responsive. The CPU usage of 53% is not a sign of trouble at all. Actually, you really want to have CPU usage pretty high; just think about it.
Please see:
http://en.wikipedia.org/wiki/Preemptive_multitasking[
^].
Now, you also need to understand that the CPU usage of your code, which is, importantly, pretty much consecutive chain of CPU commands, has nothing to do with efficiency of your code and performance of your application. It's important to complete your operation sooner, not spending less CPU resources. If you can optimize your code to have less CPU instructions to perform the same task, this would be wonderful and would really help, but it would not reduce CPU usage. The CPU usage will remain high, but you really want it to be high.
What is important, is avoid wasting resources, not using than. You could, for example cooperatively yield CPU to other threads using
Yield
or
Sleep
methods, but would it improve anything in your particular case? No! It would only delay completion of your operations and actually increase the total CPU usage, due to the overhead of yielding (additional CPU time for activation and operation of the system thread scheduler and thread switching commands).
Don't try to do it!
[EDIT]
One note of using Windows Task Manager: don't reply on it: its measurements are generally very inaccurate and don't really show what happens with processes. Usually, these measurements are not practical to be used for any judgement on application performance. For performance improvement, only a profiler can help:
http://en.wikipedia.org/wiki/Profiling_%28computer_programming%29[
^].
[END EDIT]
The concerns similar to yours are quite valid is the CPU is wasted, and some applications use CPU time where they actually do nothing. This flaw is a typical one for really poor GUI applications. If a UI application is not busy with any task; and it the user does not perform any input, the GUI application should spend strictly zero CPU time. If this is not the case, there is a bad stupid mistake. The user input should be driven by hardware interrupts. Correct GUI design makes sure the GUI thread is sleeping between event cycles spending zero of CPU. Some morons sometime use "polling" (pull model) of the user input, which is a poor waste of resource and is just generally stupid.
This is not your case, I'm sure.
Please see:
http://en.wikipedia.org/wiki/Event-driven_programming[
^],
http://en.wikipedia.org/wiki/Event-driven_architecture[
^],
http://en.wikipedia.org/wiki/Push_technology[
^],
http://en.wikipedia.org/wiki/Inversion_of_control[
^].
These references are just for your understanding; not for fixing something.
Don't worry, be happy.
—SA