求教C语言中的计时函数,可以在VC++6.0里面运行的那种,用来统计一个程序运行用了多长时间的。。谢谢

2025-03-07 10:38:53
推荐回答(1个)
回答1:



typedef long clock-t;

clock-t start,finsh; //记录开始时间和结束时间

double duration;

{ start=clock();

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

finish=clock();

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

}