Hi!
I calculated the time required for my program execution using the function Timestamp_get32(). I got negative values for time.
Time was calculated in the same way as given in the MCSDK image processing demo.
Here is my code snippet:
uint32_t ts1, ts2;
double delay=0.0f;
Types_FreqHz freq;
Timestamp_getFreq(&freq);
ts1 = (uint32_t) Timestamp_get32();
if (filter((int*) gRxBuffer,number_of_detector_rows,number_of_detector_per_row, (int*) gTxImgBuffer, number_of_projections, &delay, &pixel_width) < 0)
{
send_error_page(htmlSock, "Error in running filter");
return 1;
}
ts2 = (uint32_t) Timestamp_get32();
ts2= ts2- ts1;
delay = ((double)ts2 / (double)freq.lo) * 1000;
I also tried with the function Timestamp_get64. What does the .hi (MSB 16 bits) and .lo(LSB 16 bits) return?
double delay=0.0f;
Types_FreqHz freq;
Types_Timestamp64 ts1;
Types_Timestamp64 ts2;
Timestamp_getFreq(&freq);
Timestamp_get64(&ts1);
if (filter((int*) gRxBuffer,number_of_detector_rows,number_of_detector_per_row, (int*) gTxImgBuffer, number_of_projections, &delay, &pixel_width) < 0)
{
send_error_page(htmlSock, "Error in running filter");
return 1;
}
Timestamp_get64(&ts2);
ts2.lo = ts2.lo - ts1.lo;
delay = ((double)ts2.lo / (double)freq.lo) * 1000;
Regards,
Sohal