C# 延迟函数

#region 延迟函数
        public static bool Delay(int delayTime)
        {
            DateTime now = DateTime.Now;
            int s;
            do
            {
                TimeSpan spand = DateTime.Now - now;
                s = spand.Seconds;
                Application.DoEvents();
            }
            while (s < delayTime);
            return true;
        }
        #endregion

 

posted @ 2018-10-30 16:03  芈璐  阅读(1413)  评论(0编辑  收藏  举报