Nikhil Gupta
asked on
Create work load on window.
How can I burden the windows system so that system responds very slowly. Please tell some code in VC++ to create this situation?
Thanks in advance.
Thanks in advance.
ASKER
I think calling Sleep will cause another processes to run but i want the system load to be heavy so that all processes in the system are affected.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
int Duty = 400; // Workload for 400 miliseconds
int Idle = 600; // Sleep 600 miliseconds
int t;
while (!endflag) {
t = GetTickCount(); // miliseconds
do {
t = t; // dummy operation
} while (GetTickCount()-t < Duty);
Sleep(Idle);
}