summaryrefslogtreecommitdiff
path: root/perf/cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@fastmq.commkdir>2009-09-05 09:30:12 +0200
committerMartin Sustrik <sustrik@fastmq.commkdir>2009-09-05 09:30:12 +0200
commit67253f3186488db93dee23bd9194419f58f0b1d3 (patch)
treee5e3ed1c3f1d4b2cf5f9a1b81f869a9bd9f14c06 /perf/cpp
parent63b56d7fb38624c32111f9188d54b6fefb10a0e5 (diff)
Java perf tests added
Diffstat (limited to 'perf/cpp')
-rw-r--r--perf/cpp/local_thr.cpp2
-rw-r--r--perf/cpp/remote_lat.cpp6
2 files changed, 4 insertions, 4 deletions
diff --git a/perf/cpp/local_thr.cpp b/perf/cpp/local_thr.cpp
index ca81ba9..31fcd16 100644
--- a/perf/cpp/local_thr.cpp
+++ b/perf/cpp/local_thr.cpp
@@ -49,7 +49,7 @@ int main (int argc, char *argv [])
int rc = gettimeofday (&start, NULL);
assert (rc == 0);
- for (int i = 0; i != message_count - 1; i++) {
+ for (int i = 1; i != message_count; i++) {
s.recv (&msg);
assert (msg.size () == message_size);
}
diff --git a/perf/cpp/remote_lat.cpp b/perf/cpp/remote_lat.cpp
index c3ded10..a88d53d 100644
--- a/perf/cpp/remote_lat.cpp
+++ b/perf/cpp/remote_lat.cpp
@@ -58,13 +58,13 @@ int main (int argc, char *argv [])
end.tv_sec -= start.tv_sec;
start.tv_sec = 0;
- double usec_elapsed = (end.tv_sec * 1000000 + end.tv_usec) -
+ double elapsed = (end.tv_sec * 1000000 + end.tv_usec) -
(start.tv_sec * 1000000 + start.tv_usec);
- double latency = usec_elapsed / (roundtrip_count * 2);
+ double latency = elapsed / (roundtrip_count * 2);
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 ("mean latency: %.3f [us]\n", (double) latency);
return 0;
}