40 using std::ostringstream;
49 records_of =
new map<string, PerformanceData>();
71 LARGE_INTEGER intervals;
75 GetSystemTimeAsFileTime(&ft);
76 intervals.LowPart = ft.dwLowDateTime;
77 intervals.HighPart = ft.dwHighDateTime;
79 long double measure = intervals.QuadPart;
80 measure -= 116444736000000000.0;
81 measure /= 10000000.0;
87 gettimeofday(&tv, NULL);
89 long double measure = tv.tv_usec;
135 long double lapse = clock_end - perf_info.
clock_start;
154 long double clock_end = clock();
165 long double lapse = clock_end - perf_info.
clock_start;
175 map<string, PerformanceData>::iterator it;
187 <<
"*** PROFILING RESULTS [ms] ";
200 map<string, PerformanceData>::iterator it;
202 if (it->second.stops > 0)
report(it->first, precision, output);
225 std::cout <<
"Stopwatch active." << std::endl;
230 std::cout <<
"Stopwatch inactive." << std::endl;
244 output << std::fixed << std::setprecision(precision)
247 output << std::fixed << std::setprecision(precision)
250 output << std::fixed << std::setprecision(precision)
253 output << std::fixed << std::setprecision(precision)
256 output << std::fixed << std::setprecision(precision)
258 output << std::fixed << std::setprecision(precision)
void reset(std::string perf_name)
void set_mode(StopwatchMode mode)
void stop(std::string perf_name)
bool performance_exists(std::string perf_name)
void report(std::string perf_name, int precision=2, std::ostream &output=std::cout)
long double get_min_time(std::string perf_name)
A class representing a stopwatch.
long double get_total_time(std::string perf_name)
aligned_pair< T1, T2 > make_pair(const T1 &t1, const T2 &t2)
long double get_time_so_far(std::string perf_name)
#define STOP_WATCH_MAX_NAME_LENGTH
long double get_last_time(std::string perf_name)
std::map< std::string, PerformanceData > * records_of
long double get_max_time(std::string perf_name)
#define STOP_WATCH_TIME_WIDTH
void start(std::string perf_name)
Stopwatch & getProfiler()
void report_all(int precision=2, std::ostream &output=std::cout)
long double get_average_time(std::string perf_name)
void pause(std::string perf_name)
Stopwatch(StopwatchMode _mode=NONE)