Hi I heart that for measuring a time of loop execution in nanoseconds struct timespec could be used. However, I didn't find any info how to implement it into C code. I am wondering if it works more or less the same as clock() function
or maybe totally different. Also what libraries should I include. I am pretty sure that <unistd.h> must be used.
I would appreciate any kind of help. Thanks in advance.
Martin
Code:
int s,f;
float time;
s=clock();
/*loop*/
f=clock();
time=(f-s)/CLOCKS_PER_SEC
I would appreciate any kind of help. Thanks in advance.
Martin