时间等待

  public void Wait(uint milsecond)
        {
            long waittick = (long)10000 * milsecond;
            long tick = DateTime.Now.Ticks;
            while (tick + waittick > DateTime.Now.Ticks)
            {
                System.Threading.Thread.Sleep(100);
                System.Windows.Forms.Application.DoEvents();
            }
        }

posted on 2012-10-25 14:19  酒歌  阅读(169)  评论(0编辑  收藏  举报