6 wiscTimer::wiscTimer ()
8 tickVal
= (double) sysconf (_SC_CLK_TCK
);
13 int wiscTimer::resetTimer ()
27 int wiscTimer::startTimer ()
30 fprintf (stderr
, "Timer already started\n");
35 gettimeofday (&startTval
, NULL
);
41 int wiscTimer::stopTimer ()
44 fprintf (stderr
, "Timer NOT started\n");
49 struct timeval endTval
;
52 gettimeofday (&endTval
, NULL
);
55 double kB
, kA
, uB
, uA
, dW
;
56 kB
= ((double) startTmsval
.tms_stime
) / tickVal
;
57 kA
= ((double) endTmsval
.tms_stime
) / tickVal
;
59 uB
= ((double) startTmsval
.tms_utime
) / tickVal
;
60 uA
= ((double) endTmsval
.tms_utime
) / tickVal
;
62 dW
= ((double) (endTval
.tv_sec
- startTval
.tv_sec
)) * 1000.0 +
63 ((double) (endTval
.tv_usec
- startTval
.tv_usec
)) / 1000.0;
90 int wiscTimer::numIters ()
95 double wiscTimer::avgTime (wiscTimeType timeType
)
107 Numer
= sumResX
* 1000.0;
110 Numer
= sumUserX
* 1000.0;
113 Numer
= sumKernX
* 1000.0;
117 return (Numer
/ ((double) count
));
121 double wiscTimer::stddevTime (wiscTimeType
)