21 const size_t buf_size = 1024;
22 static char buf[buf_size];
27 current_time = time(NULL);
28 timep = localtime(¤t_time);
30 strftime(buf, buf_size,
"%Y/%m/%d %H:%M:%S %z", timep);
46 struct timeval t_start;
50 int result = getrusage(RUSAGE_SELF, &ru);
51 t_start = ru.ru_utime;
53 int result = gettimeofday(&t_start, 0);
61 m_start = (double)t_start.tv_sec + t_start.tv_usec * 1.0e-6;
77 int result = getrusage(RUSAGE_SELF, &ru);
80 int result = gettimeofday(&t_end, 0);
88 double m_end = (double)t_end.tv_sec + t_end.tv_usec * 1.0e-6;
134 double average = count ? elapsed / count : 0.0;
136 vout.
general(vl,
"Elapsed time: %s: total %12.2f sec, count %4d, average %12.2f sec\n",
m_id.c_str(), elapsed, count, average);
double elapsed_sec() const
void general(const char *format,...)
unsigned long get_counter() const
double elapsed_msec() const
void report(const Bridge::VerboseLevel vl=Bridge::GENERAL)
static const std::string class_name