原文:http://www.cnblogs.com/jxsoft/archive/2011/10/17/2215366.html
DWORD GetTickCount(void);
1) 定義
For Release configurations, this function returns the number of milliseconds since the device booted, excluding any time that the system was suspended. GetTickCount starts at 0 on boot and then counts up from there.
在Release版本中,該函數從0開始計時,返回自設備啟動后的毫秒數(不含系統暫停時間)。
For Debug configurations, 180 seconds is subtracted from the the number of milliseconds since the device booted. This allows code that uses GetTickCount to be easily tested for correct overflow handling.
在Debug版本中,設備啟動后便從計時器中減去180秒。這樣方便測試使用該函數的代碼的正確溢出處理。
Return Values
The number of milliseconds indicates success.
返回值:如正確,返回毫秒數。
Header: Winbase.h.
Link Library: Coredll.lib.
2) 應用
用來計算某個操作所使用的時間:




用來定時:

























對於一般的實時控制,使用GetTickCount()函數就可以滿足精度要求,但要進一步提高計時精度,就要采用QueryPerformanceFrequency()函數和QueryPerformanceCounter()函數。這兩個函數是VC提供的僅供Windows 9X使用的高精度時間函數,並要求計算機從硬件上支持高精度計時器。
以上引用:
http://www.wesoho.com/article.asp?id=2072
http://bitboy.blog.edu.cn/user1/19986/archives/2005/1001846.shtml