?
Solved

Create work load on window.

Posted on 2005-03-30
3
Medium Priority
?
200 Views
Last Modified: 2013-11-20
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.
0
Comment
Question by:Nikhil Gupta
  • 2
3 Comments
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 13661621
create an application with an infinite loop, the work load will depend on how many time you sleep. Something like this:

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);
}
0
 
LVL 1

Author Comment

by:Nikhil Gupta
ID: 13668627
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.
0
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 100 total points
ID: 13670357
Sleep part will let another process to run, previous part (Duty) will cause the workload, so you can graduate the load.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question