当前位置: 首页>>代码示例>>C++>>正文


C++ Stopwatch::printElapsed方法代码示例

本文整理汇总了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;
}
开发者ID:rdobson,项目名称:openpegasus,代码行数:25,代码来源:TestStopwatch.cpp

示例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();
}
开发者ID:brunolauze,项目名称:pegasus,代码行数:13,代码来源:DeliveryRetry.cpp

示例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;
}
开发者ID:brunolauze,项目名称:pegasus,代码行数:19,代码来源:DeliveryRetry.cpp

示例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;
}
开发者ID:brunolauze,项目名称:pegasus,代码行数:20,代码来源:DeliveryRetry.cpp


注:本文中的Stopwatch::printElapsed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。