請問大大如何知道處理一張圖所耗費的時間?? |
尚未結案
|
residue
中階會員 發表:90 回覆:153 積分:53 註冊:2003-07-02 發送簡訊給我 |
|
mieng
中階會員 發表:12 回覆:97 積分:81 註冊:2003-10-31 發送簡訊給我 |
|
taishyang
站務副站長 發表:377 回覆:5490 積分:4563 註冊:2002-10-08 發送簡訊給我 |
residue您好:
請參考下面連結
http://delphi.ktop.com.tw/topic.php?TOPIC_ID=26721
看看哪一種方式適合您< > 順心< >
|
residue
中階會員 發表:90 回覆:153 積分:53 註冊:2003-07-02 發送簡訊給我 |
引言: residue您好: 請參考下面連結 http://delphi.ktop.com.tw/topic.php?TOPIC_ID=26721 看看哪一種方式適合您< > 順心< > #include < time.h > float starttime,endtime,totaltime; starttime=clock(); /* 計算所需時間的程式碼放在這裡 */ endtime=clock(); totaltime=(endtime-starttime)/CLK_TCK; Edit1->Text=totaltime;感謝大大的指導請問 上面這段程式求出的時間單位為何呢??? 謝謝!! |
arisaka_matsuri
高階會員 發表:25 回覆:205 積分:231 註冊:2003-10-19 發送簡訊給我 |
另外補充:
用Windows Multimedia Timers來達成
#include
DWORD dwBegin, dwEnd; dwBegin = = timeGetTime(); // 要計時的程式碼 dwEnd = = timeGetTime(); // 顯示處理時間(單位:milliseconds) ShowMessage(AnsiString(dwEndTime-dwBeginTime) " ms");說明(轉載自 Windows Multimedia API 說明文件): Note that the value returned by the timeGetTime function is a DWORD value. The return value wraps around to 0 every 2^32 milliseconds, which is about 49.71 days.This can cause problems in code that directly uses the timeGetTime return value in computations, particularly where the value is used to control code execution. You should always use the difference between two timeGetTime return values in computations. Windows NT: The default precision of the timeGetTime function can be five milliseconds or more, depending on the machine. You can use the timeBeginPeriod and timeEndPeriod functions to increase the precision of timeGetTime. If you do so, the minimum difference between successive values returned by timeGetTime can be as large as the minimum period value set using timeBeginPeriod and timeEndPeriod. Use the QueryPerformanceCounter and QueryPerformanceFrequency functions to measure short time intervals at a high resolution, Windows 95: The default precision of the timeGetTime function is 1 millisecond. In other words, the timeGetTime function can return successive values that differ by just 1 millisecond. This is true no matter what calls have been made to the timeBeginPeriod and timeEndPeriod functions. |
taishyang
站務副站長 發表:377 回覆:5490 積分:4563 註冊:2002-10-08 發送簡訊給我 |
|
residue
中階會員 發表:90 回覆:153 積分:53 註冊:2003-07-02 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |