| 網(wǎng)站首頁 | 關(guān)于我們 | 開發(fā)優(yōu)勢 | 產(chǎn)品展示 |
| 合作企業(yè) | 新聞動態(tài) | 聯(lián)系我們 | 電話聯(lián)系 |
文章作者:濟(jì)南軟件開發(fā) 時(shí)間:2016年11月08日
今天在做一個(gè)大數(shù)據(jù)文件創(chuàng)建的時(shí)候,為了測量創(chuàng)建所用的時(shí)間,特意研究了下,windows下時(shí)間的獲取
1、55ms分辨率的計(jì)時(shí):
頭文件:#include
GetTickCount() 用法:
DWORD dwStart = GetTickCount();
functon(); // Your program.
DWORD dwEnd = GetTickCount();
DWORD dwTimes = dwEnd - dwStart;
2、10ms分辨率的計(jì)時(shí):
頭文件:
#include
#include
#pragma comment( lib,"winmm.lib" )
timeGetTime()用法:
DWORD dwStart = timeGetTime();
function; // Your program
DWORD dwEnd = timeGetTime();
DWORD dwTimes = dwEnd - dwStart;
3、1ms分辨率的計(jì)時(shí):
頭文件:
#include
clock()用法:
clock_t s_time= clock();
function();
clock_t e_time= clock();
clock_t time = e_time - s_time;
想要了解更多詳情歡迎來電咨詢18678812288
登陸網(wǎng)址:m.h6244.cn。
聯(lián)系人:王經(jīng)理。