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.

C5515中运行程序统计一个函数运行时间,使用CCS4.2中的CLOCK统计与实际耗时差距很大,为什么呢?



C5515中运行程序统计一个函数运行时间,使用CCS4.2中的CLOCK统计与实际耗时差距很大;

例如我设定的运行频率是120MHZ;

i=500;

断点1、TA_hal_PowerOnLed_On();

              while(i)

                            {

                                  Verify_Match(a,b);

                                   i--;

                           }

断点2、TA_hal_PowerOnLed_Off();

一、通过CLOCK显示从断点1到断点2耗损周期为:960,023,522    ,按理计算T1=960 023 522/120 000 000 =8 S

二、我通过使用秒表计算(通过程序控制LED亮开始到灭),耗时为:T2=38S ,按道理T1应该等于T2,为什差那么远呢?难道CLOCK统计的时钟不是系统时钟?