#include "header.h" int main(void) { int i, calls; Vector *pv; struct timeval starttime, endtime; // POSIX specific time structure gettimeofday(&starttime, NULL); // start timer printf("The input vector size = %d\n", NUM_VEC); // vector format starts with vector size for(i = 0; i < NUM_VEC; i++) { pv = creator(); // read in one vector at a time from stdin fn(pv, CALL);// count calls and compute the sum } gettimeofday(&endtime, NULL); // end timer printf("\n"); if(CALL == 1) printf("The number of calls is %d times\n", NUM_VEC); printf("The elapsed time = %f milliseconds\n", // print elapsed time (endtime.tv_usec - starttime.tv_usec)/1000.0); return EXIT_SUCCESS; }