This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DSP clock问题

C6678l,Windows XP,程序代码如下:

#include <stdio.h>

#include <time.h>

void main()

{

int i=0;

clock_t start,stop,overhead;

start=clock();

stop=clock();

overhead=stop-start;

start=clock();

for(i=0;i<1000000000;i++)

{}

stop=clock();

printf("time:%d\n",stop-start-overhead);

}

最后输出的结果是 time:0

请问为什么结果会是0,求教专家怎么能测试一个函数运行的时间?