Time delay in For loop in c#

前端 未结 7 1325
伪装坚强ぢ
伪装坚强ぢ 2020-12-06 01:18

how can i use a time delay in a loop after certain rotation? Suppose:

for(int i = 0 ; i<64;i++)
{
........
}

i want 1 sec delay after ea

7条回答
  •  粉色の甜心
    2020-12-06 02:01

    You may also want to just look into using a Timer rather than pausing the current thread in a loop.

    It will allow you to execute some block of code (repeatedly or not) after an interval of time. Without more context it would be hard to say for sure if that's best in your situation or how you would go about altering your solution accordingly.

提交回复
热议问题