[code=csharp]static void Delay(uint ms) { uint start = GetTickCount(); while (GetTickCount() - start < 1000ms) { Application.DoEvents(); } }
GetTickCount()用于获取自windows启动以来经历的时间长度(毫秒) ,是一个可以继续响应操作,而且精度高的延时函数, gettickcount()精确到55ms(1个tick就是55ms) using System.Runtime.InteropServices; [DllImport("kernel32.dll")] static extern uintGetTickCount(); http://www.4fang.net/D4/29627.html
110,571
社区成员
642,568
社区内容
加载中
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧