随笔 - 0  文章 - 5  trackbacks - 0
<2025年6月>
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345

常用链接

留言簿(2)

文章分类

文章档案

教育

信息学奥赛

有用网站

在线OJ

专题测试

租房信息

搜索

  •  

最新评论

#include<iostream>
#include<ctime>
using namespace std;
int main()
{
    clock_t begin;  //时钟类型
    for (int i=0;i<100000000;i++) ;
    cout<<(clock()-begin)/(double)CLOCKS_PER_SEC<<endl; //CLOCKS_PER_SEC: 每秒钟时钟单元数,输出单位为秒
    system("pause");
    return 0;
}

#include<iostream>
#include<cstdio>
#include<windows.h>
using namespace std;
const int N = 1e8;

int main(){
 int t1=GetTickCount();
 for (int i=0;i<N;i++);
 int t2=GetTickCount();
 cout<<(t2-t1)/1000.0<<endl;
 return 0;
}

posted on 2012-05-07 09:17 龙在江湖 阅读(210) 评论(0)  编辑 收藏 引用 所属分类: C++