Forum Discussion

KBill3's avatar
KBill3
Icon for New Contributor rankNew Contributor
7 years ago

is it possible to measure the processor time in nanoseconds? by using eclipse software.

Hallo everyone,

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 a;

int main (void)

{

clock_t t;

t = clock();

a= 1/2; -- division

t = clock() - t;

return 0;

}

Thanks in advance.

1 Reply