try
{
// get number of minutes to run from command line
// determine stopping time
// print output header
while (currentTime < stopTime) // main loop
{
for (int cycle = 0; cycle < 8; ++cycle)
{
// get the elapsed time so far // compute a random percentage
// get current memory status
// compute number bytes to eat
// allocate memory
// get current memory status
// print current time, memory status // pause to give app under test stress time // free memory
} // for loop
} // main while loop
}
catch(Exception ex)
{
Console.WriteLine(«Fatal error: « + ex.Message);
Console.ReadLine();
}
} // Main()
} // class
} // ns
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/