diff options
author | Martin Sustrik <sustrik@fastmq.commkdir> | 2009-08-30 15:47:39 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@fastmq.commkdir> | 2009-08-30 15:47:39 +0200 |
commit | 314deb61851a0ddc37228d24e9f4eb106461370a (patch) | |
tree | 8039b447b2bc3a48937a2adf69a78aee4ffe2ece /perf/cpp/local_thr.cpp | |
parent | 6c36673949b2256158e8914119d218dce311c585 (diff) |
build system for perf/C and perf/C++
Diffstat (limited to 'perf/cpp/local_thr.cpp')
-rw-r--r-- | perf/cpp/local_thr.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/perf/cpp/local_thr.cpp b/perf/cpp/local_thr.cpp index 576ac42..fdcbc8d 100644 --- a/perf/cpp/local_thr.cpp +++ b/perf/cpp/local_thr.cpp @@ -21,6 +21,8 @@ #include <stdio.h> #include <stdlib.h> #include <assert.h> +#include <stddef.h> +#include <stdint.h> #include <sys/time.h> int main (int argc, char *argv []) @@ -32,7 +34,7 @@ int main (int argc, char *argv []) } const char *bind_to = argv [1]; int message_count = atoi (argv [2]); - int message_size = atoi (argv [3]); + size_t message_size = (size_t) atoi (argv [3]); zmq::context_t ctx (1, 1); @@ -59,10 +61,10 @@ int main (int argc, char *argv []) end.tv_sec -= start.tv_sec; start.tv_sec = 0; - long long elapsed = (end.tv_sec * 1000000 + end.tv_usec) - - (start.tv_sec * 1000000 + start.tv_usec); + uint64_t elapsed = ((uint64_t) end.tv_sec * 1000000 + end.tv_usec) - + ((uint64_t) start.tv_sec * 1000000 + start.tv_usec); - long long throughput = (long long) message_count * 1000000 / elapsed; + uint64_t throughput = (uint64_t) message_count * 1000000 / elapsed; printf ("message size: %d [B]\n", (int) message_size); printf ("message count: %d\n", (int) message_count); |