Hi I need help resolving this error in the following C code. The error is
error: storage size of 't0' isn't known
error: storage size of 't1' isn't known
and I include the following
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
void timer ( void (*f) (), char letter){ //function used to calculate average runtime
int i = 0;
struct timeval t0;
struct timeval t1;
gettimeofday(&t0,0);//takes start time
for (i = 0; i < 100; i++){
f(); // runs function
}
gettimeofday(&t1,0); //takes end time
long seconds = t1.tv_sec - t0.tv_sec;
long microseconds = (t1.tv_usec - t0.tv_usec);
seconds = (1000000)*seconds + microseconds;
// printf("Total time elapsed for workload %c: %d in microseconds\n", letter, seconds );
printf("Average time elapsed for workload %c: %d %d/%d in microseconds\n", letter, seconds/100, seconds%100, 100 );//prints the average time as a whole number and then a fraction
}