Yuxin Yuan,
Please check the sequence as per below,
Types_FreqHz freq;
Int32 ts1, ts2;
double * processing_time;
Timestamp_getFreq(&freq);
ts1 = (Int32) Timestamp_get32();
----------------------
----------------------
ts2 = (Int32) Timestamp_get32();
ts2 = ts2 - ts1;
*processing_time = ((double)ts2 / (double)freq.lo) * 1000;
Note: If you have new query, create the new thread.