首页 > 其他 > 详细

在DSP671x上使用Timer统计信号处理算法的时间消耗

时间:2014-03-31 04:59:09      阅读:464      评论:0      收藏:0      [点我收藏+]

代码实例

hTimer = TIMER_open(TIMER_DEVANY,0); /* open a timer */

/* Configure the timer. 1 count corresponds to 4 CPU cycles in C67 */
/* control period initial value */
TIMER_configArgs(hTimer, 0x000002C0, 0xFFFFFFFF, 0x00000000);

/* Compute the overhead of calling the timer. */
start = TIMER_getCount(hTimer); /* to remove L1P miss overhead */
start = TIMER_getCount(hTimer); /* get count */
stop = TIMER_getCount(hTimer); /* get count */

overhead = stop - start;
start = TIMER_getCount(hTimer); /* get count */

/* Call a function here. */

/* get count */
diff = (TIMER_getCount(hTimer)  start) ? overhead; 
TIMER_close(hTimer);
printf(%d cycles \n, diff*4);

注意,C6713上定时器的一个计数值对应4个时钟周期。

overhead表示Timer本身配置过程的时钟消耗,所以有diff计算,

diff = (TIMER_getCount(hTimer)  start) ? overhead; /* get count */

在DSP671x上使用Timer统计信号处理算法的时间消耗,布布扣,bubuko.com

在DSP671x上使用Timer统计信号处理算法的时间消耗

原文:http://blog.csdn.net/xiahouzuoxin/article/details/22622093

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!