C#延时函数,能延时小数ms的函数

引用: 
using System.Threading.Tasks;
using System.Windows.Forms;
public void DoDelay(double milliSecond)//延时函数
        {
            int start = Environment.TickCount;
           
            while (Environment.TickCount < (start + milliSecond))
            {
                if (Environment.TickCount < start) return;
                Application.DoEvents();
            }
        }

 

posted @ 2021-07-10 10:36  Cmale  阅读(259)  评论(0)    收藏  举报