39 #include <SPL/config.hpp>
42 #if defined(SPL_HAVE_SYS_TIME_H)
100 #if defined(SPL_HAVE_GETTIMEOFDAY)
101 struct timeval startTime_;
102 struct timeval stopTime_;
106 #if defined(SPL_HAVE_GETTIMEOFDAY)
110 if (gettimeofday(&startTime_, 0)) {
113 std::cerr <<
"warning: gettimeofday failed\n";
114 startTime_.tv_sec = 0;
115 startTime_.tv_usec = 0;
121 if (gettimeofday(&stopTime_, 0)) {
124 std::cerr <<
"warning: gettimeofday failed\n";
125 stopTime_.tv_sec = 0;
126 stopTime_.tv_usec = 0;
134 t0 = ((double) startTime_.tv_sec) + ((double) startTime_.tv_usec) / 1e6;
135 t1 = ((double) stopTime_.tv_sec) + ((double) stopTime_.tv_usec) / 1e6;
double get() const
Get the timer value.
void stop()
Stop the timer.
Definition: Arcball.hpp:48
double getPeakMemUsage()
Get the peak memory usage for the process.
Definition: Timer.cpp:149
double getCurrentMemUsage()
Get the amount of memory currently being used by the process.
Definition: Timer.cpp:154
void start()
Start the timer.
A class for making timing measurements.
Definition: Timer.hpp:61