summaryrefslogtreecommitdiff
path: root/perf/c/remote_lat.c
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@fastmq.commkdir>2009-09-02 14:59:53 +0200
committerMartin Sustrik <sustrik@fastmq.commkdir>2009-09-02 14:59:53 +0200
commitf92de9b2a9ad73fd7cd966e65b5a06b725e779fc (patch)
tree119769a0bf8623e5c266c232eb1ee29cccaaa1af /perf/c/remote_lat.c
parent702fdbb5dd6a83e7f656e8d1190e695ebb636765 (diff)
bug during terminal shutdown fixed
Diffstat (limited to 'perf/c/remote_lat.c')
-rw-r--r--perf/c/remote_lat.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/perf/c/remote_lat.c b/perf/c/remote_lat.c
index e99da2e..32329b8 100644
--- a/perf/c/remote_lat.c
+++ b/perf/c/remote_lat.c
@@ -59,18 +59,20 @@ int main (int argc, char *argv [])
rc = gettimeofday (&start, NULL);
assert (rc == 0);
+ rc = zmq_msg_init_size (&msg, message_size);
+ assert (rc == 0);
+
for (i = 0; i != roundtrip_count; i++) {
- rc = zmq_msg_init_size (&msg, message_size);
- assert (rc == 0);
rc = zmq_send (s, &msg, 0);
assert (rc == 0);
rc = zmq_recv (s, &msg, 0);
assert (rc == 0);
assert (zmq_msg_size (&msg) == message_size);
- rc = zmq_msg_close (&msg);
- assert (rc == 0);
}
+ rc = zmq_msg_close (&msg);
+ assert (rc == 0);
+
rc = gettimeofday (&end, NULL);
assert (rc == 0);
@@ -83,7 +85,10 @@ int main (int argc, char *argv [])
printf ("message size: %d [B]\n", (int) message_size);
printf ("roundtrip count: %d\n", (int) roundtrip_count);
- printf ("average latency: %3f [us]\n", (double) latency);
+ printf ("average latency: %.3f [us]\n", (double) latency);
+
+ rc = zmq_term (ctx);
+ assert (rc == 0);
return 0;
}