作者james999 (無傷大雅)
看板C_and_CPP
標題[問題] MFC 想要計時器功能,該如何實現呢?
時間Tue Jan 22 18:41:04 2019
開發平台(Platform): (Ex: Win10, Linux, ...)
Windows
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
MFC
問題(Question):
目前打算在某個按鍵被按下後啟動這個計時器(精確至毫秒),
然後可能用戶在進行其他操作時,我能夠獲取這個計時器從按下按鍵後經過的時間,
請問MFC的Timer能做嗎? 抑或有其他方式能分享給我呢? 謝謝:)
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 220.132.128.217
※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1548153666.A.901.html
→ Schottky: 只要看時間的話,建議用 QueryPerformanceCounter() 01/22 20:46
→ Schottky: 按鈕時看一次時間記下來,之後再看時間相減 01/22 20:46
→ Schottky: 精確度可以問 QueryPerformanceCounter() 01/22 20:47
→ Schottky: 只要你用的是 PC,精確度必定 < 1 ns 01/22 20:48
推 soheadsome: c++11應該蠻容易有timer 01/22 21:37
推 Schottky: 我賭100P,原PO那版 Visual Studio 不支援 C++11 XDDDD 01/22 22:21