17 if (gettimeofday(&time, NULL))
22 return (
double)time.tv_sec + (double)time.tv_usec * .000001;
32 return (
double)clock() / CLOCKS_PER_SEC;
44 wh = (int)wtime / 3600;
45 ch = (int)cptime / 3600;
46 wmin = ((int)wtime % 3600) / 60;
47 cpmin = ((int)cptime % 3600) / 60;
48 wsec = wtime - (3600. * wh + 60. * wmin);
49 csec = cptime - (3600. * ch + 60. * cpmin);
50 printf(
"Wall Time : %d hours and %d minutes and %.4f seconds.\n", wh, wmin, wsec);
51 printf (
"CPU Time : %d hours and %d minutes and %.4f seconds.\n",ch,cpmin,csec);
56 #endif // !UTILITY_HPP double get_cpu_time()
Definition: utility.hpp:25
void display_timing(double wtime, double cptime)
Definition: utility.hpp:35
double get_wall_time()
Definition: utility.hpp:9