14 #include <sys/resource.h> 34 #ifdef TIME_WITH_SYS_TIME 36 # ifdef HAVE_SYS_TIME_H 37 # include <sys/time.h> 40 # ifdef HAVE_SYS_TIME_H 41 # include <sys/time.h> 47 #ifdef HAVE_SYS_TIMES_H 48 #include <sys/times.h> 69 getrusage(RUSAGE_SELF,&
t_rec);
71 +
t_rec.ru_stime.tv_sec*1000000+
t_rec.ru_stime.tv_usec
73 getrusage(RUSAGE_CHILDREN,&
t_rec);
75 +
t_rec.ru_stime.tv_sec*1000000+
t_rec.ru_stime.tv_usec
77 return (
int)time(
NULL);
82 getrusage(RUSAGE_SELF,&
t_rec);
86 getrusage(RUSAGE_CHILDREN,&
t_rec);
98 getrusage(RUSAGE_SELF,&
t_rec);
102 getrusage(RUSAGE_CHILDREN,&
t_rec);
115 #ifdef EXTEND_TIMER_D 122 getrusage(RUSAGE_SELF,&
t_rec);
126 getrusage(RUSAGE_CHILDREN,&
t_rec);
134 #ifdef EXTEND_TIMER_D 137 if (timer_resolution==(
double)1.0)
138 Print(
"//%s %.2f sec\n" ,v ,f);
140 Print(
"//%s %.2f/%d sec\n" ,v ,f,(
int)timer_resolution);
149 static struct timezone
tzp;
158 #ifdef HAVE_GETTIMEOFDAY 174 gettimeofday(&now, &
tzp);
176 if (
startRl.tv_usec > now.tv_usec)
178 now.tv_usec += 1000000;
197 gettimeofday(&now, &
tzp);
201 now.tv_usec += 1000000;
210 Print(
"//%s %.2f sec \n" ,v ,f);
static double timer_resolution
void writeTime(const char *v)
static struct timeval siStartRTime
void SetTimerResolution(int res)
static struct rusage t_rec
void SetMinDisplayTime(double mtime)
static struct timezone tzp
const Variable & v
< [in] a sqrfree bivariate poly
static struct timeval startRl
void writeRTime(const char *v)