40 using std::ostringstream;
52 records_of =
new map<string, PerformanceData>();
74 LARGE_INTEGER intervals;
78 GetSystemTimeAsFileTime(&ft);
79 intervals.LowPart = ft.dwLowDateTime;
80 intervals.HighPart = ft.dwHighDateTime;
82 long double measure = intervals.QuadPart;
83 measure -= 116444736000000000.0;
84 measure /= 10000000.0;
90 gettimeofday(&tv, NULL);
92 long double measure = tv.tv_usec;
138 long double lapse = clock_end - perf_info.
clock_start;
157 long double clock_end = clock();
168 long double lapse = clock_end - perf_info.
clock_start;
178 map<string, PerformanceData>::iterator it;
188 output <<
"\n*** PROFILING RESULTS [ms] (min - avg - max - lastTime - " 189 "nSamples - totalTime) ***\n";
190 map<string, PerformanceData>::iterator it;
192 report(it->first, precision, output);
215 std::cout <<
"Stopwatch active." << std::endl;
220 std::cout <<
"Stopwatch inactive." << std::endl;
237 output << perf_name << pad;
238 output << std::fixed << std::setprecision(precision)
239 << (perf_info.
min_time * 1e3) <<
"\t";
240 output << std::fixed << std::setprecision(precision)
242 output << std::fixed << std::setprecision(precision)
243 << (perf_info.
max_time * 1e3) <<
"\t";
244 output << std::fixed << std::setprecision(precision)
246 output << std::fixed << std::setprecision(precision) << perf_info.
stops 248 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)
long double get_time_so_far(std::string perf_name)
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_MAX_NAME_LENGTH
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)