#include <sys/time.h>
#include <iostream>
int main(int argc, char **argv) {
// ProcessTime example
struct timeval startTime;
struct timeval endTime;
// get the current time
// - NULL because we don't care about time zone
gettimeofday(&startTime, NULL);
// algorithm goes here
what_you_want_to_time();
// get the end time
gettimeofday(&endTime, NULL);
// calculate time in microseconds
double tS = startTime.tv_sec*1000000 + (startTime.tv_usec);
double tE = endTime.tv_sec*1000000 + (endTime.tv_usec);
std::cout << "Total Time Taken: " << tE - tS << std::endl;
return 0;
}