Create work load on window.

Posted on 2005-03-30
Medium Priority
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.
Question by:Nikhil Gupta
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
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);

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.
LVL 55

Accepted Solution

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.

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

764 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