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.

AM335x DMtimer tick for time measurement

Hi,

I am using bare metal programming using TI starterware and trying to use the DMtimer tick count to profile a function. There is already example code which uses DMtimer7 to get the timer count and calculate the time. The code goes like this.

DelayTimerSetup();
PerfTimerSetup();

 PerfTimerStart(); // Start the timer

Call your functions to be profiled here

ticksRead = PerfTimerStop(); // Get the current count value

time_taken=(unsigned long )(ticksRead /(CLK_EXT_CRYSTAL_SPEED / 1000));

Where CLK_EXT_CRYSTAL_SPEED = (24 * 1000 * 1000)

As per the comments, this will return the time taken in milliseconds. 

Here my Question is what is divided by 1000 mean here?. As i understand  1/CLK_EXT_CRYSTAL_SPEED gives the unit time and ticksRead will give number of ticks read. So the time taken should be unit_time x number of ticks!

Please suggest.