- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I used the time.h to get the snippet code's time spent by C on PC, and it worked:
#include <time.h>
//in some function:
clock_t start, end;
start = clock();
//some code...
end = clock();
float diff = end - start; //ms
However, while testing the above code on FX3, the compiler showed error:
timesr.c:(.text+0x8): undefined reference to `_times'
collect2.exe: error: ld returned 1 exit status
cs-make: *** [Rheia.elf] Error 1
How to solve that? Or I need to use other way on FX3?
Any help will be highly appreciated!
Solved! Go to Solution.
- Labels:
-
USB Superspeed Peripherals
- Tags:
- fx3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
It seems that you are trying to get the execution time of the code using the timer ticks.
If yes, please let me know if you can you try using the CyU3PGetTime API from the FX3 SDK to get the number of elapsed OS timer ticks and based on that you would get the execution time in millisecond.
I just came across similar query on a forum
Rashi