Author: Tomas Rutkauskas
How to assign an application to have a smaller percentage of the CPU cycles
Answer:
The rest of this may take a little time, and is quite CPU intensive, so try and
drop to a lower priority if possible. Drop to low priority for CPU-intensive parts.
1 2 saved_priority_class := GetPriorityClass(GetCurrentProcessID);
3 if saved_priority_class <> 0 then4 SetPriorityClass(GetCurrentProcess, IDLE_PRIORITY_CLASS);
5 6 { CPU intensive stuff here ... }7 8 {Restore normal priority}9 if saved_priority_class <> 0 then10 SetPriorityClass(GetCurrentProcess, saved_priority_class);