本文整理汇总了C++中Stopwatch::printElapsed方法的典型用法代码示例。如果您正苦于以下问题:C++ Stopwatch::printElapsed方法的具体用法?C++ Stopwatch::printElapsed怎么用?C++ Stopwatch::printElapsed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stopwatch
的用法示例。
在下文中一共展示了Stopwatch::printElapsed方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char** argv)
{
verbose = getenv("PEGASUS_TEST_VERBOSE") ? true : false;
Stopwatch sw;
sw.start();
System::sleep(5);
sw.stop();
double elapsed = sw.getElapsed();
if(verbose)
{
sw.printElapsed();
}
PEGASUS_TEST_ASSERT((elapsed >= 4.5) && (elapsed <= 5.5));
cout << argv[0] << " +++++ passed all tests" << endl;
return 0;
}
示例2: _testRetryAttemptsExceededIndications
static void _testRetryAttemptsExceededIndications(CIMClient &client)
{
Stopwatch watch;
watch.start();
cout << "Testing the retry attempts exceeded indications..." << endl;
_generateIndications(client, MAX_INDICATIONS);
System::sleep(3);
_generateIndications(client, MAX_INDICATIONS);
_waitForSequenceIdentifierLifetimeExpiration(client, 2 * MAX_INDICATIONS);
watch.stop();
cout << "Completed in ";
watch.printElapsed();
}
示例3: _testIndicationsWithListenerNotRunning
static void _testIndicationsWithListenerNotRunning(CIMClient &client)
{
Stopwatch watch;
watch.start();
cout << "Testing indications with listener not running..." << endl;
CIMListener listener(2003);
DeliveryRetryTestConsumer* consumer = new DeliveryRetryTestConsumer("1");
listener.addConsumer(consumer);
_generateIndications(client, MAX_INDICATIONS);
_waitForNextMaxSequenceNumber(client);
listener.start();
_waitForIndications(client, consumer, HANDLER_COUNT * MAX_INDICATIONS);
_testIndications(consumer->getIndications());
watch.stop();
cout << "Completed in ";
watch.printElapsed();
listener.stop();
delete consumer;
}
示例4: _testIndicationsWithListenerRunning
static void _testIndicationsWithListenerRunning(CIMClient &client)
{
Stopwatch watch;
watch.start();
cout << "Testing indications with listener running..." << endl;
CIMListener listener(2003);
DeliveryRetryTestConsumer* consumer = new DeliveryRetryTestConsumer("1");
listener.addConsumer(consumer);
listener.start();
_generateIndications(client, MAX_INDICATIONS);
_waitForIndications(client, consumer, HANDLER_COUNT * MAX_INDICATIONS);
#ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
_testIndications(consumer->getIndications());
#endif
watch.stop();
cout << "Completed in ";
watch.printElapsed();
delete consumer;
}