Delay while loop after each iteration
How to delay the while loop after each iteration for some seconds without using thread.sleep in winforms .net 3.5 ?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Nitesh KejriwalPosted Sep 7, 2014, 11:36 PM
while()
{
//Perform Operation here
Thread.Sleep(3000);
}
VulpesPosted Sep 7, 2014, 12:15 PM
However, it's not a great solution because it will just keep the processor busy doing nothing during the delay period and will probably prevent other threads from being scheduled. In contrast, Thread.Sleep only suspends the current thread.