I am using iMX8M Quad EVK. I am trying to use clock_gettime() to calculate how much time myfunction runs on Cortex-M4. But stop.tv_nsec and start.tv_nsec both are zero.
clock_gettime(CLOCK_REALTIME, &start);
myfunction(s1, b_fb, y);
clock_gettime(CLOCK_REALTIME, &stop);
printf("%ld\n", stop.tv_nsec);
printf("%ld\n", start.tv_nsec);
Thanks.
Xianju
this may help you
c - What is the proper way to use clock_gettime()? - Stack Overflow