error: syntax error before 't'
warning: type defaults to 'int' in declaration of 't'
warning: implicit declaration of function 'GetTime'
error: initializer element is not constant
warning: data definition has no type or storage class
the best way is to look at an unused timer, start it, and read the timer register before and after the event you need to measure. It will be a rough measure in any case.
Most demos contain info on how to start / stop timers.
or you can use EE_hal_gettime defined in mcu/microchip_dspic/inc/ee_mcu.h which uses timer8 and timer9.