#include "kernel/mod2.h"
#include <sys/resource.h>
#include <unistd.h>
#include <stdio.h>
#include <time.h>
#include <sys/time.h>
#include "reporter/reporter.h"
#include "kernel/oswrapper/timer.h"
Go to the source code of this file.
◆ getRTimer()
Definition at line 170 of file timer.cc.
171{
172 struct timeval now;
173
174 gettimeofday(&now, &
tzp);
175
176 if (
startRl.tv_usec > now.tv_usec)
177 {
178 now.tv_usec += 1000000;
179 now.tv_sec --;
180 }
181
184 (double) 1000000;
185
187}
STATIC_VAR double timer_resolution
STATIC_VAR struct timeval startRl
STATIC_VAR struct timezone tzp
◆ getTimer()
Definition at line 95 of file timer.cc.
96{
98 getrusage(RUSAGE_SELF,&
t_rec);
102 getrusage(RUSAGE_CHILDREN,&
t_rec);
109}
STATIC_VAR struct rusage t_rec
STATIC_VAR int64 siStartTime
◆ initRTimer()
Definition at line 156 of file timer.cc.
157{
158#ifdef HAVE_GETTIMEOFDAY
161#else
164#endif
165}
STATIC_VAR struct timeval siStartRTime
◆ initTimer()
Definition at line 67 of file timer.cc.
68{
69 getrusage(RUSAGE_SELF,&
t_rec);
71 +
t_rec.ru_stime.tv_sec*1000000+
t_rec.ru_stime.tv_usec
72 +5000)/10000;
73 getrusage(RUSAGE_CHILDREN,&
t_rec);
75 +
t_rec.ru_stime.tv_sec*1000000+
t_rec.ru_stime.tv_usec
76 +5000)/10000;
77 return (
int)time(
NULL);
78}
◆ SetMinDisplayTime()
void SetMinDisplayTime |
( |
double |
mtime | ) |
|
Definition at line 27 of file timer.cc.
28{
30}
STATIC_VAR double mintime
◆ SetTimerResolution()
void SetTimerResolution |
( |
int |
res | ) |
|
◆ startRTimer()
void startRTimer |
( |
void |
| ) |
|
◆ startTimer()
Definition at line 80 of file timer.cc.
81{
82 getrusage(RUSAGE_SELF,&
t_rec);
86 getrusage(RUSAGE_CHILDREN,&
t_rec);
90}
◆ writeRTime()
void writeRTime |
( |
const char * |
v | ) |
|
Definition at line 193 of file timer.cc.
194{
195 struct timeval now;
196
197 gettimeofday(&now, &
tzp);
198
200 {
201 now.tv_usec += 1000000;
202 now.tv_sec --;
203 }
204
207 (double) 1000000;
208
210 Print(
"//%s %.2f sec \n" ,
v ,
f);
211}
const Variable & v
< [in] a sqrfree bivariate poly
◆ writeTime()
void writeTime |
( |
const char * |
v | ) |
|
Definition at line 119 of file timer.cc.
120{
122 getrusage(RUSAGE_SELF,&
t_rec);
126 getrusage(RUSAGE_CHILDREN,&
t_rec);
133 {
134#ifdef EXTEND_TIMER_D
136#else
138 Print(
"//%s %.2f sec\n" ,
v ,
f);
139 else
141#endif
142 }
143}
VAR char my_yylinebuf[80]
◆ mintime
◆ rtimerv
◆ siStartRTime
◆ siStartTime
◆ startl
◆ startRl
◆ t_rec
◆ timer_resolution
◆ timerv
◆ tzp