程序计时的两种方法
来源:互联网 发布:sql模糊查询[] 编辑:程序博客网 时间:2024/05/14 16:11
一。 调用API函数GetTickCount()
#include <windows.h>
#include <iostream>
int main()
{
using namespace std;
DWORD dwStartTick = GetTickCount();
for (int i=0;i<100;i++)
{
cout << i ;
}
DWORD dwDuration = GetTickCount() - dwStartTick;
cout << dwDuration; //返回毫秒
return 0;
}
二。调用库函数clock()
#include <time.h>
#include <iostream>
int main()
{
using namespace std;
double time;
clock_t tStart = clock();
//do your work..
for (int i=0;i<100;i++)
{
cout << i ;
}
time = (double)(clock() - tStart) / CLOCKS_PER_SEC;
cout << time;
return 0;
}
- 程序计时的两种方法
- 程序计时的两种方法
- Android中计时的两种方法
- .net中的两种计时方法
- 给程序计时的方法1
- 程序计时方法
- 程序计时方法
- Opencv中三种遍历元素的方法及程序计时方法
- VC计时的程序
- 一个程序运行计时方法
- C++常见程序计时方法
- ubuntu下程序计时方法
- linux下程序计时方法
- C++常见程序计时方法
- 测量程序执行时间的两种方法
- 创建程序的两种方法
- 获取程序执行时间的两种方法
- vtk程序的cmake两种方法
- Mike Meyers' A+ Certification Passport, Third Edition
- The Rails Way
- 关于rman 备份
- 原型设计工具
- MATLAB Demystified
- 程序计时的两种方法
- SharePoint 2007: The Definitive Guide [ILLUSTRATED]
- WCDMA for UMTS: HSPA Evolution and LTE
- Linux System Programming: Talking Directly to the Kernel and C Library [ILLUSTRATED]
- python3k与python2.x共存下使得django应用正常解决之道
- Prototype and script.aculo.us: You Never Knew JavaScript Could Do This!
- 12.5-12.7
- Beginning Joomla!: From Novice to Professional
- IBM-142-XML认证