A
Arlef
Basically, I have this piece of code and it put my cpu usages to 100%.
However, in I uncomment the sleep line that sleeps the current thread the
CPU tends to be about 50%. I know that this is centred around the
Application.DoEvents() method. Is there a proper way to do this such that
we can eliminate the call to Thread.Sleep(100); ?
Form1 TheForm = new Form1();
TheForm.Show();
while(TheForm.Created)
{
TheForm.TheRosettes.incrementSize();
TheForm.TheRosettes.rotateRosettesRight();
TheForm.TheRosettes.Invalidate();
// System.Threading.Thread.Sleep(100);
Application.DoEvents();
}
Many thanks for your help!
Junior
However, in I uncomment the sleep line that sleeps the current thread the
CPU tends to be about 50%. I know that this is centred around the
Application.DoEvents() method. Is there a proper way to do this such that
we can eliminate the call to Thread.Sleep(100); ?
Form1 TheForm = new Form1();
TheForm.Show();
while(TheForm.Created)
{
TheForm.TheRosettes.incrementSize();
TheForm.TheRosettes.rotateRosettesRight();
TheForm.TheRosettes.Invalidate();
// System.Threading.Thread.Sleep(100);
Application.DoEvents();
}
Many thanks for your help!
Junior