IAR确定某一段代码的执行时间

一、接出一个I/O口,设置反转,用示波器测量时间。

二、软件仿真,计算寄存器CYCLECOUNTER值差。

设置软件仿真,如图:

下载,运行,在运行程序的两端设置断点,并打开View -> Register ,软件仿真时计算两断点CYCLECOUNTER的差值,乘与指令周期便是时间。

The CYCLECOUNTER register in IAR Embedded Workbench are useful to check how many cycles that are consumed for the running code. The CCSTEP register is handy and useful when checking the number of cycles during the last performed C/C++ source or assembler step.  

放一张图:其中CCTIMER1/2的值是可以修改的。

397 Comments

Add a Comment

电子邮件地址不会被公开。