1

I have a while loop like this in my Console Application:

count = 0;
while (count < 60)
{
   count++; 
}

Okay so this loop runs very fast.

What i want is that it only adds count++ maybe once every second.

Is this somehow possible to do?

0

1 Answer 1

1

Use Thread.Sleep

count = 0;
while (count < 60)
{
   Thread.Sleep(1000);  // waiting for 1 second
   count++; 
}
2
  • that worked for me, thanks!
    – AlpakaJoe
    Nov 29, 2018 at 0:01
  • 1
    Glad to have been of help Nov 29, 2018 at 0:01

Not the answer you're looking for? Browse other questions tagged or ask your own question.