1. clock_t clock( void );

表示所属进程自调用以来,已经逝去的tick数目。常被作为计时函数使用。

typedef long clock_t;

clock_t start,finsh;   //记录开始时间和结束时间

double duration;

start=clock();

{ 任意想记录时间的程序}

finish=clock();

duration=(double)(finish-start)/CLOCKS_PER_SEC;

待续。。。

相关文章:

  • 2022-12-23
  • 2021-08-29
  • 2021-08-02
  • 2021-12-04
  • 2022-12-23
  • 2021-12-04
  • 2021-10-27
猜你喜欢
  • 2021-06-12
  • 2021-12-04
  • 2021-11-30
  • 2022-01-02
  • 2021-12-04
相关资源
相似解决方案