Created
December 10, 2011 15:19
-
-
Save yangg/1455388 to your computer and use it in GitHub Desktop.
延时函数(不假死)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Runtime.InteropServices; | |
[DllImport("kernel32.dll")] | |
static extern uint GetTickCount(); | |
static void Delay(uint ms) { | |
uint start = GetTickCount(); | |
while (GetTickCount() - start < ms) { | |
Application.DoEvents(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment