(file) Return to timing.c CVS log (file) (dir) Up to [Development] / JSOC / proj / globalhs / apps

 1 tplarson 1.2 char *cvsinfo_timing = "cvsinfo: $Header: timing.c $";
 2              
 3 tplarson 1.1 double getwalltime(void)
 4              {
 5                struct timeval tv;
 6                gettimeofday(&tv, NULL);
 7                return tv.tv_sec * 1000.0 + tv.tv_usec/1000.0;
 8              }
 9              
10              double getcputime(double *utime, double *stime)
11              {
12              
13                struct rusage ru;
14                getrusage(RUSAGE_SELF, &ru);
15                *utime = ru.ru_utime.tv_sec * 1000.0 + ru.ru_utime.tv_usec/1000.0;
16                *stime = ru.ru_stime.tv_sec * 1000.0 + ru.ru_stime.tv_usec/1000.0;
17                return *utime + *stime;
18              }

Karen Tian
Powered by
ViewCVS 0.9.4