25 num_utts_(0), total_audio_(0.0), total_time_taken_(0.0),
26 total_time_waited_(0.0), max_delay_(0.0) {
34 idle_percent = 100.0 * idle_proportion;
36 KALDI_LOG <<
"Timing stats: real-time factor was " << real_time_factor
37 <<
" (note: this cannot be less than one.)";
38 KALDI_LOG <<
"Average delay was " << average_wait <<
" seconds.";
39 if (idle_percent != 0.0) {
42 KALDI_LOG <<
"Percentage of time spent idling was " << idle_percent;
55 KALDI_LOG <<
"Timing stats: real-time factor for offline decoding was " 56 << real_time_factor <<
" = " 63 utterance_id_(utterance_id), waited_(0.0), utterance_length_(0.0) { }
74 double to_wait = cur_utterance_length - (elapsed +
waited_);
85 double to_wait = cur_utterance_length - elapsed;
99 if (wait_time < 0.0) {
103 KALDI_WARN <<
"Negative wait time " << wait_time
104 <<
" does not make sense.";
106 KALDI_VLOG(2) <<
"Latency " << wait_time <<
" seconds out of " 107 << utterance_length_ <<
", for utterance " This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
std::string utterance_id_
void Sleep(float seconds)
void OutputStats(OnlineTimingStats *stats)
This call, which should be made after decoding is done, writes the stats to the object that accumulat...
void Print(bool online=true)
Here, if "online == false" we take into account that the setup was used in not-really-online mode whe...
void SleepUntil(double cur_utterance_length)
The call to SleepUntil(t) will sleep until cur_utterance_length seconds after this object was initial...
double total_time_waited_
double Elapsed()
Returns the simulated time elapsed in seconds since the timer was started; this equals waited_ plus t...
std::string max_delay_utt_
#define KALDI_ASSERT(cond)
class OnlineTimingStats stores statistics from timing of online decoding, which will enable the Print...
double Elapsed() const
Returns time in seconds.
void WaitUntil(double cur_utterance_length)
The call to WaitUntil(t) simulates the effect of sleeping until cur_utterance_length seconds after th...
OnlineTimer(const std::string &utterance_id)