————谁知道时间等待函数?
谁知道VC里的时间等待函数?
在DELPHI中是SLEEP,那么C中呢?
问题点数:10、回复次数:7Top
1 楼netcliff(中山狼)回复于 2002-05-20 21:33:54 得分 1
也是sleepTop
2 楼feihong6(蓝天飞鸿)回复于 2002-05-20 21:37:18 得分 0
netcliff(中山狼) 那么具体参数呢?Top
3 楼y_may(witch)回复于 2002-05-20 21:40:57 得分 3
sleep(10);//就是sleep 10ms由此类推,参数应该是整型Top
4 楼morningsing(奈何)回复于 2002-05-20 21:41:43 得分 1
参数仅仅是毫秒数
如:Sleep(1000),就是等待1秒钟Top
5 楼songhonda(小笨鼠)回复于 2002-05-20 21:42:28 得分 1
sleep()
delay()Top
6 楼lant(蓝特)回复于 2002-05-20 21:55:11 得分 1
Sleep
The Sleep function suspends the execution of the current thread for a specified interval.
VOID Sleep(
DWORD dwMilliseconds // sleep time in milliseconds
);
Parameters
dwMilliseconds
Specifies the time, in milliseconds, for which to suspend execution. A value of zero causes the thread to relinquish the remainder of its time slice to any other thread of equal priority that is ready to run. If there are no other threads of equal priority ready to run, the function returns immediately, and the thread continues execution. A value of INFINITE causes an infinite delay.
Top
7 楼Alice_Hexj(侠盗)回复于 2002-05-20 21:59:27 得分 1
在VC中同样是Sleep,具体的定义看MSDN,如下:
VOID Sleep(
DWORD dwMilliseconds // sleep time in milliseconds
);
Top
8 楼victorlee_lq(victor)回复于 2002-05-20 22:11:06 得分 2
是Sleep,它是个API函数。
在主线程里小心使用,会dead lock!!Top




