在C语言中,怎么测试运行程序所用的时间?

2025-04-07 23:17:12
推荐回答(1个)
回答1:

#include
#include
int main( )
{
long start,end;
start = clock();

//测试的程序段

end = clock();

printf("%ld\n",start-end);//单位:毫秒
return 0;
}