#include <log.h>
Definition at line 142 of file log.h.
PerformanceTimer::PerformanceTimer |
( |
| ) |
|
|
inline |
void PerformanceTimer::begin |
( |
| ) |
|
|
inline |
void PerformanceTimer::end |
( |
| ) |
|
|
inline |
static int64_t PerformanceTimer::query |
( |
| ) |
|
|
inlinestatic |
Definition at line 151 of file log.h.
152 #if defined(_POSIX_TIMERS) && (_POSIX_TIMERS > 0)
154 clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts);
155 return int64_t(ts.tv_sec)*1000000000 + ts.tv_nsec;
156 #elif defined(RUSAGE_SELF)
157 struct rusage rusage;
159 if (getrusage(RUSAGE_SELF, &rusage) == -1) {
163 t = 1000000000ULL * (int64_t) rusage.ru_utime.tv_sec + (int64_t) rusage.ru_utime.tv_usec * 1000ULL;
164 t += 1000000000ULL * (int64_t) rusage.ru_stime.tv_sec + (int64_t) rusage.ru_stime.tv_usec * 1000ULL;
169 #error Dont know how to measure per-process CPU time. Need alternative method (times()/clocks()/gettimeofday()?).
YS_NORETURN void log_cmd_error(const char *format,...) YS_ATTRIBUTE(format(printf
void PerformanceTimer::reset |
( |
| ) |
|
|
inline |
float PerformanceTimer::sec |
( |
| ) |
const |
|
inline |
int64_t PerformanceTimer::total_ns |
The documentation for this struct was generated from the following file: