23 void start(){ gettimeofday(&startTime, NULL); }
29 long seconds, useconds;
31 gettimeofday(&endTime, NULL);
32 seconds = endTime.tv_sec - startTime.tv_sec;
33 useconds = endTime.tv_usec - startTime.tv_usec;
34 duration = seconds + useconds/1E6f;
44 printf(
"Elapsed Time: %5.6f seconds\n", duration);
void start()
Starts the timer.
Definition: timer.h:23
double stop()
Stops the timer.
Definition: timer.h:26
static void printTime(double const &duration)
Prints enlapsed time.
Definition: timer.h:42
The Timer class.
Definition: timer.h:19