记录程序运行时间的程序实例
2014-11-10 13:33
197 查看
记录一个程序所用时间,另外在linux服务器上提交东西的指令
yhrun -p TH_NEW ./a.out >
yhrun -p TH_NEW ./a.out >
1 #include <cstdio> 2 #include <ctime> 3 #include <cstdlib> 4 #include <sys/time.h> 5 #include <time.h> 6 struct node { 7 int a[3]; 8 }; 9 node ans [16][3920][18000]; 10 int main() 11 { 12 printf("start!\n"); 13 int a; 14 srand(0); 15 struct timeval tv_start,tv_end; 16 gettimeofday(&tv_start,NULL); 17 //程序 27 gettimeofday(&tv_end,NULL); 28 printf("time: %lf\n",tv_end.tv_sec - tv_start.tv_sec+(tv_end.tv_usec - tv_start.tv_ usec)/1000000.0); 29 return 0; 30 }
相关文章推荐
- 一个用Spring AOP实现异常处理和记录程序执行时间的实例(一)
- c++中记录程序运行时间的函数
- 用于记录程序运行时间
- matlab中,计算,记录,程序运行,起始,结束 时间,间隔 &matlab中 tic,toc函数的用法
- R语言记录程序运行的时间
- c++记录程序运行时间
- 一个用Spring AOP实现异常处理和记录程序执行时间的实例(二)
- 用clock函数来记录程序运行时间
- 记录程序运行时间之clock 函数
- matlab中记录程序运行时间
- 用c++实现记录程序运行时间的类
- 记录程序运行时间
- 记录程序运行时间
- C/C++记录程序运行时间的类
- 5.11 一个用Spring AOP实现异常处理和记录程序执行时间的实例
- 编程基本功——记录程序的运行时间
- 全局记录程序片段的运行时间 正确找到程序逻辑耗时多的断点
- 记录程序的运行时间
- C#记录程序运行时间记录显示
- c++中记录程序运行时间的函数