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.

Council about using CLK_gethtime();

if you want to watch the execution of the code,  shows in milliseconds

 

#include <clk.h>
#include <gbl.h>

//---------------------

Uint32  new_time    = 0;
Uint32  old_time    = 0;
Uint32 delta_time  = 0;
float CPUcycles    = 0;
float TimeAbsolute = 0;

//-------------------------------
//---------------------------------

old_time = CLK_gethtime();
//------------------------------------------------------------
processing...

//------------------------------------------------------------

   new_time = CLK_gethtime();
   delta_time = (new_time - old_time);
   CPUcycles = delta_time * CLK_cpuCyclesPerHtime();
   TimeAbsolute = CPUcycles / GBL_getFrequency();  //  in msec

Works perfectly,

Good luck,

Igor.