本文整理汇总了C++中TimeInterval::MicroSeconds方法的典型用法代码示例。如果您正苦于以下问题:C++ TimeInterval::MicroSeconds方法的具体用法?C++ TimeInterval::MicroSeconds怎么用?C++ TimeInterval::MicroSeconds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TimeInterval
的用法示例。
在下文中一共展示了TimeInterval::MicroSeconds方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LogTime
void Tracker::LogTime() {
TimeStamp now;
m_clock.CurrentTime(&now);
TimeInterval delta = now - m_send_time;
if (delta > m_max) {
m_max = delta;
}
m_sum += delta.MicroSeconds();
OLA_INFO << "RPC took " << delta;
if (FLAGS_count == ++m_count) {
m_wrapper.GetSelectServer()->Terminate();
} else {
SendRequest();
}
}
示例2: Start
void Tracker::Start() {
ola::io::SelectServer *ss = m_wrapper.GetSelectServer();
m_signal_thread.InstallSignalHandler(
SIGINT,
ola::NewCallback(ss, &ola::io::SelectServer::Terminate));
m_signal_thread.InstallSignalHandler(
SIGTERM,
ola::NewCallback(ss, &ola::io::SelectServer::Terminate));
SendRequest();
ss->Execute(ola::NewSingleCallback(this, &Tracker::StartSignalThread));
ss->Run();
// Print this via cout to ensure we actually get some output by default
// It also means you can just see the stats and not each individual request
// if you want.
cout << "--------------" << endl;
cout << "Sent " << m_count << " RPCs" << endl;
cout << "Max was " << m_max.MicroSeconds() << " microseconds" << endl;
cout << "Mean " << m_sum / m_count << " microseconds" << endl;
}