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.

How to get the elapsed time between to points at a 1 to ten-microsec precision ?

Other Parts Discussed in Thread: CONTROLSUITE

Hi,

I try to obtain the time elapsed between the beginning of my background loop but I failed...

I have 2 ways to do : - Whithout using DSP / BIOS : I don't know how to do..

                                     - With DSP / BIOS but the code which following my text doesn't work...There are somme error (#20 "LgUns" not identified...)

#include <stdio.h>
#include <stdlib.h>


#include <std.h>
#include <log.h>
#include <clk.h>
#include <tsk.h>
#include <gbl.h>

#include "PeripheralHeaderIncludes.h"


    unsigned long start, stop, time_elapsed;
    start = (CLK_getltime() * (CLK_getprd())) / CLK_countspms();

    stop = (CLK_getltime() * (CLK_getprd())) / CLK_countspms();
    time_elapsed = stop - start;

So How can I do to get the time elapsed with a timer which can be reseted for example (because of 16 or 32 bits limits) ? Thank you