TI中文支持网
TI专业的中文技术问题搜集分享网站

clock测试程序运行时间问题。

程序是在omapl138中的dsp6748中运行的

 start = clock ();

 stop = clock ();

 overhead = stop – start ;

 start = clock ();

 …(test code)

 stop = clock ();

 cycles = stop – start – overhead;

现在发现clock的返回值总是0,

这个事什么原因?

Shine:

试试下面的代码

LgUns time1, time2, timediff;

Float CPUcycles;

// benchmarking the process() DSP call

time1 = CLK_gethtime();

   ….stuff to be benchmarked…

time2 = CLK_gethtime();

CPUcycles = time2-time1;

timediff = CPUcycles / CLK_countspms();

赞(0)
未经允许不得转载:TI中文支持网 » clock测试程序运行时间问题。
分享到: 更多 (0)