#include
#include
int main(void)
{
unsigned int a = 10,b = 20,c;
clock_t start,stop, overhead,cycles;
start = clock();
stop = clock();
overhead = stop - start;
start = clock();
//测试代码开始
c = a + b;
c++;
//测试代码结束
stop = clock();
cycles = stop - start - overhead;
printf("cycles: %d
",cycles);
printf("times: %.2f us with CPU 456MHz.
",((float) cycles /(float)456));
return 0;
}