计算一段程序的执行时间
2013-07-01 21:17
267 查看
// 计算程序执行时间.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <stdio.h> #include <iostream> #include <time.h> void do_something() { for(int i=0;i<100000;i++) for(int j=0;j<10000;j++) ; } int main(int arg,char ** argv) { clock_t start=clock(); do_something(); clock_t end=clock(); float time=(float)(end-start)/CLOCKS_PER_SEC; printf("%fs\n",time); system("pause"); return 0; }
相关文章推荐
- 计算两个时间的时间差 就是 计算执行一段程序使用的时间
- 计算一段程序的执行时间
- 计算一段程序执行的时间
- CCS中使用DSP定时器的计时程序,可以精确计算某一段程序的执行时间
- c# 计算程序执行时间,计算一段代码执行所用的时间,测试效率
- 计算一段代码的执行时间
- 抽象模板-计算程序的执行时间
- C++高精度计算程序执行时间
- php计算当前程序执行时间示例
- lr计算程序执行消耗时间的比较:
- VS2015测试某一段程序执行时间
- C#计算一段程序运行时间的三种方法
- java 计算程序执行时间
- C# 程序找出文件重复的行,计算函数执行的时间
- C#计算程序执行过程花费时间的方法
- php使用microtime(true)计算php程序代码执行消耗时间
- 关于java读文件计算一个方法执行时间的程序的学习
- 计算程序执行的时间,可以作为写代码的参考
- 计算程序执行时间的命令行工
- 计算程序执行时间的脚本python3.6(Win7x64)