本文整理汇总了C++中Timer::CurrentTime方法的典型用法代码示例。如果您正苦于以下问题:C++ Timer::CurrentTime方法的具体用法?C++ Timer::CurrentTime怎么用?C++ Timer::CurrentTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Timer
的用法示例。
在下文中一共展示了Timer::CurrentTime方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Execute
void TimerTest::Execute() {
Assert("Initial Time should be zero", Timer().CurrentTime() == 0);
THROWCHECK("Stopping a timer that hasn't been started", Timer().Stop());
THROWCHECK("Starting a timer that has already been started", Timer().Start().Start());
Timer timer = Timer().Start();
Wait(.1);
Assert("Timer should now be greater than ,1", timer.CurrentTime() >= .1);
timer.Stop();
Assert("Timer should still be greater than ,1", timer.CurrentTime() >= .1);
timer.Start();
Wait(.1);
Assert("Timer should now be greater than ,1", timer.CurrentTime() >= .2);
timer.Stop();
Assert("Timer should still be greater than ,1", timer.CurrentTime() >= .2);
{
TIMETHISBLOCK("1");
{
TIMETHISBLOCK("2");
}
{
TIMETHISBLOCK("3");
}
}
// TODO check output of this
TimingPool::TimingSummary();
}
示例2: TimingSummary
std::string TimingPool::TimingSummary() {
const Timer internalTimer = Timer().Start();
const int timingIterations = 1000000;
for (int i = 0 ; i < timingIterations ; i++)
{
TIMETHISBLOCK("InternalTiming");
}
const double averageTimerTime = internalTimer.CurrentTime()/timingIterations;
return ::TimingSummary("", static_cast<TimerTree*>(m_timerStack.Pointer()), m_names, averageTimerTime).first;
}