精華區beta Programming 關於我們 聯絡資訊
==> 在 "Cheng-jen Tang" <ctang@cat.syr.edu> 的文章中提到: > pinbin wrote in message <3SUJ1Z$v5l@bbs.cis.nctu.edu.tw>... > > 用過了Sleep(n), 但一使用這個, 好像整個程示當掉 > ^^^^^^^^^^^^^^^^ ??? > Why feel strange? It should be like that... 在多緒程式中, 其中一個thread使用了Sleep(n)也會造成整個 程式好像當掉嗎??因為我寫的是多緒程式, 只在其中一個thread 使用Sleep(n), 而整個程式連主視窗都無法show出, 因此才覺的 其怪..:).. > > 的感覺, 我只是想讓某function在間隔n秒後繼序執行, > > 因為那個物件不是視窗, 因此也沒辦法用OnTimer來作 > > ,請問有沒替代OnTimer的功能的function嗎?? > WaitForSingleObject() ... -- * Origin: ★ 交通大學資訊科學系 BBS ★ <bbs.cis.nctu.edu.tw: 140.113.23.3> > -------------------------------------------------------------------------- < 發信人: "Tomas Kang" <hmkang@ms2.hinet.net>, 看板: Programming 標 題: Re: 如何讓程式暫停一下再繼續執行呢?? 發信站: (null) (Sun Jan 24 09:56:18 1999) 轉信站: Ptt!news.ntu!ctu-gate!news.nctu!netnews.csie.nctu!news.dj.net.tw!t232- vee vee vee vee <ccos.bbs@bbs.ntu.edu.tw> 次寫入到主題 <0008RC$wz3@bbs.ntu.edu.tw>... > ==> heibow.bbs@cis.nctu.edu.tw (空中雲雀) 提到: > > sleep 是 c 的 function > > FORTRAN 我是不知道啦 > > 不過要 delay 是有其他的方法...只是不是很準確... > > FORTRAN 也可做迴圈吧 ? > > 做一個空的迴圈...看要重複幾次由你定吧 > > 也可以不是空的迴圈.. 裡面做一些無關緊要的運算... > Well, I know that. But by doing this way, you need 2 calibrate > > the pause time for different machine... /_\ > > There are several ways to obtain precision timing informations, listed in the preference order: 1. Library functions supported by the language in use. 2. Windows API (if runs under Windows) 3. DOS Functions 4. BIOS 5. Direct programming of the 8253 PTC timer on the PC Just choose one that is appropriate for your application and find them from the appropriate documents. -- 市隱