38 std::vector<double> multi_time;
39 std::vector<double> time;
46 void addMultiMaxTime()
49 if(multi_time.empty())
51 for(std::vector<double>::iterator it = multi_time.begin(); it != multi_time.end(); ++it)
56 time.push_back( max );
63 void addMultiMinTime()
66 if(multi_time.empty())
68 for(std::vector<double>::iterator it = multi_time.begin(); it != multi_time.end(); ++it)
73 time.push_back( min );
108 gettimeofday(&timerStart, NULL);
116 gettimeofday(&timerEnd, NULL);
118 multi_time.push_back( (((timerEnd.tv_sec - timerStart.tv_sec) * 1000000u + timerEnd.tv_usec - timerStart.tv_usec) / 1.e6) * 1000 );
120 time.push_back( (((timerEnd.tv_sec - timerStart.tv_sec) * 1000000u + timerEnd.tv_usec - timerStart.tv_usec) / 1.e6) * 1000 );
153 double totalTime = 0.0f;
155 for(std::vector<double>::iterator it = time.begin(); it != time.end(); ++it)
168 double totalTime = 0.0f;
170 for(std::vector<double>::iterator it = time.begin(); it != time.end(); ++it)
175 return (
double)(totalTime/time.size());
184 for(std::vector<double>::iterator it = time.begin(); it != time.end(); ++it)
199 for(std::vector<double>::iterator it = time.begin(); it != time.end(); ++it)
213 double result = 0.0f;
216 gettimeofday(&tStart, NULL);
217 gettimeofday(&tEnd, NULL);
223 gettimeofday(&tStart, NULL);
224 for(
int i = 0; i < delay; ++i) ;
225 gettimeofday(&tEnd, NULL);
227 result = ((((double)tEnd.tv_sec)*1000000.0) + ((double)tEnd.tv_usec)) - ((((
double)tStart.tv_sec)*1000000.0) + ((double)tStart.tv_usec));
double getResolutionUs()
Definition: timer_linux.h:211
void reset()
Definition: timer_linux.h:126
double getMinTime()
Definition: timer_linux.h:196
double getTotalTime()
Definition: timer_linux.h:151
double getMaxTime()
Definition: timer_linux.h:181
T min(T a, T b)
Definition: mapoverlap_convol_kernels.h:212
int getNumTimings()
Definition: timer_linux.h:238
void start_record_multi()
Definition: timer_linux.h:82
void stop_record_multi()
Definition: timer_linux.h:92
double getTime(int run=0)
Definition: timer_linux.h:143
double getAverageTime()
Definition: timer_linux.h:166
T max(T a, T b)
Definition: mapoverlap_convol_kernels.h:203
void stop()
Definition: timer_linux.h:114
A class that can be used measure time on Linux systems.
Definition: timer_linux.h:29
void start()
Definition: timer_linux.h:106