summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/tests/latencytest.cpp
diff options
context:
space:
mode:
authorStephen D. Huston <shuston@apache.org>2008-10-29 22:11:46 +0000
committerStephen D. Huston <shuston@apache.org>2008-10-29 22:11:46 +0000
commit5cf1f788cd9cab916f3ac4f382e0d5fb3453ae22 (patch)
treedb67a95f9f74b5e7a1e54d01943a381532f13163 /qpid/cpp/src/tests/latencytest.cpp
parent50d6ab5d1a74bec0fa8ac456f333333dcb92bae7 (diff)
downloadqpid-python-5cf1f788cd9cab916f3ac4f382e0d5fb3453ae22.tar.gz
Allow AbsTime and Duration to be used cross-platform; add usleep() wrapper. Related to QPID-1209
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@709028 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/latencytest.cpp')
-rw-r--r--qpid/cpp/src/tests/latencytest.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/qpid/cpp/src/tests/latencytest.cpp b/qpid/cpp/src/tests/latencytest.cpp
index a980a43322..763ce5a85a 100644
--- a/qpid/cpp/src/tests/latencytest.cpp
+++ b/qpid/cpp/src/tests/latencytest.cpp
@@ -26,13 +26,13 @@
#include <memory>
#include <sstream>
#include <vector>
-#include <unistd.h>
#include "TestOptions.h"
#include "qpid/client/Connection.h"
#include "qpid/client/Message.h"
#include "qpid/client/AsyncSession.h"
#include "qpid/client/SubscriptionManager.h"
+#include "qpid/sys/Time.h"
using namespace qpid;
using namespace qpid::client;
@@ -342,7 +342,7 @@ void Sender::sendByRate()
uint64_t timeTaken = (now - start_msg) / TIME_USEC;
if (timeTaken < interval) {
- usleep(interval - timeTaken);
+ qpid::sys::usleep(interval - timeTaken);
} else if (timeTaken > interval &&
!opts.csv && !opts.cumulative) { // Don't be so verbose in this case, we're piping the results to another program
std::cout << "Could not achieve desired rate! (Took " << timeTaken
@@ -411,7 +411,7 @@ int main(int argc, char** argv)
}
if (opts.rate && !opts.timeLimit) {
while (true) {
- usleep(opts.reportFrequency * 1000);
+ qpid::sys::usleep(opts.reportFrequency * 1000);
//print latency report:
for (boost::ptr_vector<Test>::iterator i = tests.begin(); i != tests.end(); i++) {
i->report();