Hi all,
I want to measure the number of cpu cycles between two operations in a c program. I am running a BBB rev C.1 on Debian (3.8.13-bone70). My code is pretty simple:
#include <stdio.h>
#include <time.h>
int main(void) {
clock_t start,stop;
start=clock();
`
int j;
for(j=0;j<12345;j++){
; // burn time
}
stop=clock();
printf(“used cycles: %f\n”,(long)(stop-start));
return (0);
}
`
The output is not satisfiing
root@beaglebone:/home/debian# ./getCycles
used cycles: 0.000000
This is the way I always did that in the past as far as I remember. Did I miss something? Maybe like additional support packages? Thank you in advance!