本文实例讲述了C#实现程序等待延迟执行的方法。分享给大家供大家参考。具体如下:
[System.Runtime.InteropServices.Dllimport("kernel32.dll")]
static extern uint GetTickCount();
///
/// 程序等待延迟执行
///
///
static void MySleep(uint ms)
{
uint start = GetTickCount();
while (GetTickCount() - start < ms)
{
Application.DoEvents();
}
}
希望本文所述对大家的C#程序设计有所帮助。



