I wrote a simple program in C++ like:
while(1){var+=1;var-=1;}
and ran it, but it seems to only use 25% of CPU.
How can I increase the amount of CPU that my program will use, to 95%?
I wrote a simple program in C++ like:
while(1){var+=1;var-=1;}
and ran it, but it seems to only use 25% of CPU.
How can I increase the amount of CPU that my program will use, to 95%?
Sounds like you're running this on a 4-processor system. You are using 100% of the CPU on one core. To use the other cores, you will have to write a multi-thread version of your application.
Multi-threading is very complicated, but there are lots of good tutorials out there; just hit up Google. Good luck!