|
发表于 2020-1-20 11:36:02
|
显示全部楼层
让当前线程暂停几秒,系统执行其他线程
Delay(3);
#region 延时(单位为秒)
public void Delay(int delayTime)
{
DateTime now = DateTime.Now;
int s;
do
{
TimeSpan spand = DateTime.Now - now;
s = spand.Seconds;
Application.DoEvents();
}
while (s < delayTime);
}
#endregion |
|