//计算机器运行时间

 

 

 

long i = 10000000L;
clock_t start, finish;
double duration;
//测量一个事件持续的时间
printf( "Time to do %ld empty loops is ", i) ;
start = clock();
while( i-- );
finish = clock();
duration = (double)(finish - start) / CLOCKS_PER_SEC;
printf( "%f seconds\n", duration );
system("pause");

相关文章:

  • 2021-12-10
  • 2021-12-11
  • 2021-12-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-16
  • 2022-01-08
猜你喜欢
  • 2021-12-28
  • 2021-12-18
  • 2022-12-23
  • 2021-04-16
  • 2022-02-11
  • 2022-12-23
相关资源
相似解决方案