c++ - Program not using all of CPU? -
this question has answer here:
- how 100% cpu usage c program 7 answers
i wrote simple program in c++ like:
while(1){var+=1;var-=1;}
and ran it, seems use 25% of cpu.
how can increase amount of cpu program use, 95%?
sounds you're running on 4-processor system. are using 100% of cpu on 1 core. use other cores, have write multi-thread version of application.
multi-threading complicated, there lots of tutorials out there; hit google. luck!
Comments
Post a Comment