04-05-2018 06:46 AM
Currently i am working on Zygo(Zync702) board and i want to find the time taken by print function to put strings on Uart terminal, in my c code. Is there any way like SysTick timer of ARM Processor to find the time taken by a set of C code?
Basically i want to know the execution time of instructions.
Thanks in advance.
04-10-2018 12:01 AM
If you want to calculate the time taken to execute a piece of code, have to included timers in the hardware design.
Later at software application below reference will help you to do calculate the execution time.
You can use the following template:
Xtime tStart, tEnd;
Printf("Output took %llu clock cycles. \n", 2*(tEnd-tStart));
Printf("Output took %.2f s.\n",ElapsedTime);