C语言怎么写延时函数,精确到毫秒

要用上 GetTickCount() 的哦
麻烦加点注释
程序运行到有延时函数的地方,卡住一段时间,才能进行下去

第1个回答  2013-10-13
唯有Sleep函数,只有Sleep函数参数是用毫秒,比如1000毫秒等于1秒。
第2个回答  推荐于2017-09-10
void delay(unsigned int ms)
{
unsigned int begin= GetTickCount();

while((GetTickCount()-begin)<ms) {
;

}

}本回答被提问者采纳
第3个回答  2013-10-13
建议直接使用 Sleep 函数,可以 #include <windows.h> 后再使用