Topic: How to write the code consuming about 10 % of the processor?
Task statement the following: I have a code which in a cycle considers an arithmetical progression from 1 to n. Naturally this code consumes entirely one kernel, that is 100 % CPU. Also fulfills, we admit for a day. And me in general arranges, if the result is in 10 days, let the code works as a background easy and does not hinder to be played the computer. For this purpose it is necessary to tell somehow to the code that it worked more slowly. But how? On idea it is a question to those who did an operating system, probably in everyone there are any plugins for such pieces, but such probably it is possible to make and . A flow which more slowly the core for certain can be created? Meanwhile the cleverest that I invented - to do sleep. But it can is possible somehow on another? UPD. The code is written by me. I can edit and collect it anew. Restrictions that it is possible to work only with - is not present.