I am trying to find out time taken by a function to compute how much time it takes
struct timeval myTime_1;
struct timeval myTime_2;
printf ("Time taken = %ld", myTime_2.tv_sec - myTime_1.tv_sec);
is this the accurate way or some other better way of doing this?