activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r551586 - /activemq/activemq-cpp/trunk/src/examples/main.cpp
Date Thu, 28 Jun 2007 14:49:36 GMT
Author: tabish
Date: Thu Jun 28 07:49:35 2007
New Revision: 551586

URL: http://svn.apache.org/viewvc?view=rev&rev=551586
Log:
https://issues.apache.org/activemq/browse/AMQCPP-93

adding timing to the example for comparisons

Modified:
    activemq/activemq-cpp/trunk/src/examples/main.cpp

Modified: activemq/activemq-cpp/trunk/src/examples/main.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/examples/main.cpp?view=diff&rev=551586&r1=551585&r2=551586
==============================================================================
--- activemq/activemq-cpp/trunk/src/examples/main.cpp (original)
+++ activemq/activemq-cpp/trunk/src/examples/main.cpp Thu Jun 28 07:49:35 2007
@@ -23,6 +23,7 @@
 #include <activemq/core/ActiveMQConnectionFactory.h>
 #include <activemq/util/Integer.h>
 #include <activemq/util/Config.h>
+#include <activemq/util/Date.h>
 #include <cms/Connection.h>
 #include <cms/Session.h>
 #include <cms/TextMessage.h>
@@ -343,6 +344,8 @@
     bool useTopics = true;
     int numMessages = 2000;
 
+    long long startTime = Date::getCurrentTimeMilliseconds();
+
     HelloWorldProducer producer( brokerURI, numMessages, useTopics );
     HelloWorldConsumer consumer( brokerURI, numMessages, useTopics );
 
@@ -361,11 +364,12 @@
     producerThread.join();
     consumerThread.join();
 
+    long long endTime = Date::getCurrentTimeMilliseconds();
+    double totalTime = (endTime - startTime) / 1000.0;
+
+    std::cout << "Time to completion = " << totalTime << " seconds." <<
std::endl;
     std::cout << "-----------------------------------------------------\n";
-    std::cout << "Finished with the example, ignore errors from this"
-              << std::endl
-              << "point on as the sockets breaks when we shutdown."
-              << std::endl;
+    std::cout << "Finished with the example." << std::endl;
     std::cout << "=====================================================\n";
 }
 



Mime
View raw message