标签:orm sys 调用 name use ios 毫秒级 clock 开机
1、毫秒级
#include<iostream> using namespace std; int main(){ DWORD start= ::GetTickCount(); //获取毫秒级数目 Sleep(1000); cout << ::GetTickCount() - start<< endl; system("pause"); }
2. 使用clock()
#include <iostream> #include <time.h> #include <Windows.h> using namespace std; int main(){ clock_t start; start = clock(); Sleep(1000); cout<<clock()-start<<" ms"<<endl; system("pause"); }
2、微秒级
#include <stdio.h> #include <math.h> #include <windows.h> using namespace std; void main() { LARGE_INTEGER cpuFreq; LARGE_INTEGER startTime; LARGE_INTEGER endTime; double rumTime=0.0; QueryPerformanceFrequency(&cpuFreq); QueryPerformanceCounter(&startTime); Sleep(1000); QueryPerformanceCounter(&endTime); rumTime = (((endTime.QuadPart - startTime.QuadPart) * 1000.0f) / cpuFreq.QuadPart); cout << rumtTime << " ms" << endl; }
标签:orm sys 调用 name use ios 毫秒级 clock 开机
原文地址:http://www.cnblogs.com/chensheng-zhou/p/6323174.html