19 #ifndef KALDI_BASE_TIMER_H_ 20 #define KALDI_BASE_TIMER_H_ 26 #if defined(_MSC_VER) || defined(MINGW) 35 explicit Timer(
bool set_timer) {
if (set_timer)
Reset(); }
41 LARGE_INTEGER time_end;
43 QueryPerformanceCounter(&time_end);
45 if (QueryPerformanceFrequency(&freq) == 0) {
49 return (static_cast<double>(time_end.QuadPart) -
51 (
static_cast<double>(freq.QuadPart));
69 explicit Timer(
bool set_timer) {
if (set_timer)
Reset(); }
75 struct timeval time_end;
76 struct timezone time_zone;
77 gettimeofday(&time_end, &time_zone);
80 static_cast<double>(
time_start_.tv_usec)/(1000*1000);
81 t2 =
static_cast<double>(time_end.tv_sec) +
82 static_cast<double>(time_end.tv_usec)/(1000*1000);
97 Profiler(
const char *function_name): name_(function_name) { }
108 #define KALDI_PROFILE Profiler _profiler(__func__) 115 #endif // KALDI_BASE_TIMER_H_ This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
struct timeval time_start_
Profiler(const char *function_name)
struct timezone time_zone_
double Elapsed() const
Returns time in seconds.