summaryrefslogtreecommitdiff
path: root/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
commitfd0ee666d7d2026b81e3aaa85e15f380c32f109f (patch)
treeebfe7fcad03d8d43eb14867a99af372518a1a817 /cpp/src/tests/latencytest.cpp
parent6d26c9b2c8a19cfd23336d2498bcad561a4458f6 (diff)
downloadqpid-python-fd0ee666d7d2026b81e3aaa85e15f380c32f109f.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/qpid@709028 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/latencytest.cpp')
-rw-r--r--cpp/src/tests/latencytest.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/cpp/src/tests/latencytest.cpp b/cpp/src/tests/latencytest.cpp
index a980a43322..763ce5a85a 100644
--- a/cpp/src/tests/latencytest.cpp
+++ b/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();