本文整理汇总了C++中RelativeTime::inMilliseconds方法的典型用法代码示例。如果您正苦于以下问题:C++ RelativeTime::inMilliseconds方法的具体用法?C++ RelativeTime::inMilliseconds怎么用?C++ RelativeTime::inMilliseconds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RelativeTime
的用法示例。
在下文中一共展示了RelativeTime::inMilliseconds方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addLoadSample
void LoadMonitor::addLoadSample (LoadEvent const& sample)
{
std::string const& name (sample.name());
RelativeTime const latency (sample.getSecondsTotal());
if (latency.inSeconds() > 0.5)
{
WriteLog ((latency.inSeconds() > 1.0) ? lsWARNING : lsINFO, LoadMonitor)
<< "Job: " << name << " ExecutionTime: " << printElapsed (sample.getSecondsRunning()) <<
" WaitingTime: " << printElapsed (sample.getSecondsWaiting());
}
// VFALCO NOTE Why does 1 become 0?
std::size_t latencyMilliseconds (latency.inMilliseconds());
if (latencyMilliseconds == 1)
latencyMilliseconds = 0;
ScopedLockType sl (mLock, __FILE__, __LINE__);
update ();
++mCounts;
++mLatencyEvents;
mLatencyMSAvg += latencyMilliseconds;
mLatencyMSPeak += latencyMilliseconds;
// VFALCO NOTE Why are we multiplying by 4?
int const latencyPeak = mLatencyEvents * latencyMilliseconds * 4;
if (mLatencyMSPeak < latencyPeak)
mLatencyMSPeak = latencyPeak;
}
示例2: heartbeat
void heartbeat()
{
if (mNeedToEnd)
{
Time now = Time::getCurrentTime();
RelativeTime dt = (now - mLastXYTime);
if (dt.inMilliseconds() > 200)
{
mEditor->getMover()->end(kOsc);
mNeedToEnd = false;
}
}
if (!mAddress) return;
int src = mEditor->getOscLeapSource();
if (src != mSource)
{
String s = "Source "; s << (src+1);
lo_send(mAddress, kSelectSourcePath, "s", s.toRawUTF8());
mSource = src;
}
FPoint p = mFilter->getSourceXY01(src);
if (mSourceXY != p)
{
//fprintf(stderr, "sent new pos to %s\n", kSourceXYPath);
lo_send(mAddress, kSourceXYPath, "ff", p.y, p.x);
mSourceXY = p;
}
}
示例3: inputAttemptWhenModal
void CallOutBox::inputAttemptWhenModal()
{
if (dismissalMouseClicksAreAlwaysConsumed
|| targetArea.contains (getMouseXYRelative() + getBounds().getPosition()))
{
// if you click on the area that originally popped-up the callout, you expect it
// to get rid of the box, but deleting the box here allows the click to pass through and
// probably re-trigger it, so we need to dismiss the box asynchronously to consume the click..
// For touchscreens, we make sure not to dismiss the CallOutBox immediately,
// as Windows still sends touch events before the CallOutBox had a chance
// to really open.
RelativeTime elapsed = Time::getCurrentTime() - creationTime;
if (elapsed.inMilliseconds() > 200)
dismiss();
}
else
{
exitModalState (0);
setVisible (false);
}
}