i have a cyclone V Altera, i did a division operation of two integer numbers by using eclipse software (in c code). I need to measure the processor time, i means how much time will be taken for this function to be done. Of course it is happening in nanosecond. Is there any function, or method using timer or something else to measure the processor time in nanosecond.
the code is like that;
#include <stdio.h> /* printf */
#include <time.h> /* clock_t, clock, CLOCKS_PER_SEC */
int main (void)
t = clock();
a= 1/2; -- division
t = clock() - t;
Thanks in advance.
- The number of instructions which take more than one clock cycle is determined by the complexity of the ALU and its pipelining architecture. Therefore, the minimum and maximum cycles per instruction depend on the core you choose (Nios® II/f, Nios II/s, Nios II/e). Normal ALU instructions take 6 cycles for Nios II/e core.
- If you use functions to measure, Even it takest few clock cycle.
- You can check an391 for some methods to measure processing time/function time.
Refer below links.