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 ?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
VulpesRank #55 · 29.2K reputationPosted Sep 7, 2014, 8:15 AM EDT
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.
Nitesh KejriwalRank #253 · 9.9K reputationPosted Sep 7, 2014, 7:36 PM EDT
while()
{
//Perform Operation here
Thread.Sleep(3000);
}