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.

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



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

 start = clock ();

 stop = clock ();

 overhead = stop - start ;

 start = clock ();

 ...(test code)

 stop = clock ();

 cycles = stop - start - overhead;

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

这个事什么原因?

  • 试试下面的代码

    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();