您可以使用自定义秒表组件(附加)来测量某些代码消耗的CPU时钟周期。它使用系统SyBIT定时器来计算CPU周期。该组件未完成,但适用于PSoC4、4M和5LP。要测量CPU时钟,请在代码中放置StaseWistBoad Stor()和StaseWistFixStor(),并在终端上打印结果:
StaseWistBoad启动();/重置定时器
/你的代码在这里(函数,ISR等)
…
停止计时()
UTIT32总线锁=停止表周期;//读取结果
要将秒表组件添加到项目中,请将其从附件演示项目导入。
停止手表P4MY001.PNG
70.4 K
停止手表P4MY01A.PNG
49.1 K
TopWistApP4MY01-1000.CyWrk.SaveV01.Zip
1.4兆字节
以上来自于百度翻译
以下为原文
You can measure amount of CPU clock cycles consumed by some piece of code using custom StopWatch component (attached). It uses system SysTick timer to count CPU cycles. The component is rather unfinished, but works for PSoC4, 4M and 5LP. To measure CPU clocks put StopWatch_Start() and StopWatch_Stop() in your code, and print result on terminal:
StopWatch_Start() ; // reset timer
// your code is here (function, ISR, etc.)
.....
StopWatch_Stop() ; // stop timer
uint32 BusClockTicks = StopWatch_Cycles; // read result
To add StopWatch component to you project, Import it from the demo project attached.
您可以使用自定义秒表组件(附加)来测量某些代码消耗的CPU时钟周期。它使用系统SyBIT定时器来计算CPU周期。该组件未完成,但适用于PSoC4、4M和5LP。要测量CPU时钟,请在代码中放置StaseWistBoad Stor()和StaseWistFixStor(),并在终端上打印结果:
StaseWistBoad启动();/重置定时器
/你的代码在这里(函数,ISR等)
…
停止计时()
UTIT32总线锁=停止表周期;//读取结果
要将秒表组件添加到项目中,请将其从附件演示项目导入。
停止手表P4MY001.PNG
70.4 K
停止手表P4MY01A.PNG
49.1 K
TopWistApP4MY01-1000.CyWrk.SaveV01.Zip
1.4兆字节
以上来自于百度翻译
以下为原文
You can measure amount of CPU clock cycles consumed by some piece of code using custom StopWatch component (attached). It uses system SysTick timer to count CPU cycles. The component is rather unfinished, but works for PSoC4, 4M and 5LP. To measure CPU clocks put StopWatch_Start() and StopWatch_Stop() in your code, and print result on terminal:
StopWatch_Start() ; // reset timer
// your code is here (function, ISR, etc.)
.....
StopWatch_Stop() ; // stop timer
uint32 BusClockTicks = StopWatch_Cycles; // read result
To add StopWatch component to you project, Import it from the demo project attached.
举报