SuperHebbe
Programmer
Hi
In my stats program I have a a lot of big loops to process some log files, and each time the CPU goes all the way up to 100% even I had set priority to the lowest (IDLE_PRIORITY_CLASS)
I tried this code to prevent the CPU to go so high:
It works, but slows down the program...
Is there another way to do this?
PS! I can't see that this 100% CPU peak does anything to other programs on my computer, but other users "think" it's does that because they are seeing the 100% CPU peak.
Thanks
Jan Erik
In my stats program I have a a lot of big loops to process some log files, and each time the CPU goes all the way up to 100% even I had set priority to the lowest (IDLE_PRIORITY_CLASS)
I tried this code to prevent the CPU to go so high:
Code:
UBYTE sleep_counter = 0;
for (i = 0; i < size; i++)
{
if (sleep_counter == 200)
{
sleep (1);
sleep_counter = 0;
}
DoStuff here...
}
It works, but slows down the program...
Is there another way to do this?
PS! I can't see that this 100% CPU peak does anything to other programs on my computer, but other users "think" it's does that because they are seeing the 100% CPU peak.
Thanks
Jan Erik