So this is pretty basic, but I don’t really know C.
I want to find the number of milliseconds something takes to run, not clock (CPU) cycles.
I tried using
struct timeval start,end;
double dif;
gettimeofday(&start, 0);
//do stuff
gettimeofday(&end, 0);
dif = (end - start) / 1000.0;
printf("The time taken was %lf \n",dif);
I’m getting this error when I’m trying to compile:
bubble.c: In function ‘main’:
bubble.c:55: error: invalid
operands to binary – (have ‘struct timeval’ and ‘struct timeval’)
Change
to
In pseudocode: