From e7fb92e33a10519dd9d3abccb67264b1228e2f43 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Sun, 27 Mar 2011 12:33:05 -0400 Subject: [PATCH] Add msgcount option to test3_latency --- server/test3_latency.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/server/test3_latency.c b/server/test3_latency.c index 36a17a7..8cb2fcb 100644 --- a/server/test3_latency.c +++ b/server/test3_latency.c @@ -54,11 +54,12 @@ int main(int argc, char *argv[]) { long bytecount = 0; int i; unsigned long hz_limit = 1000000; + unsigned long msgcount = 10000000; assert(sizeof(uint32_t) == 4); if (argc < 2) { - fprintf(stderr, "Usage: test1 []\n"); + fprintf(stderr, "Usage: test1 [ []]\n"); exit(1); } @@ -67,6 +68,11 @@ int main(int argc, char *argv[]) { } printf("hz_limit = %lu\n", hz_limit); + if (argc > 3) { + msgcount = strtoul(argv[3], NULL, 0); + } + printf("msgcount = %lu\n", msgcount); + { struct hostent *h = gethostbyname(argv[1]); if (h == NULL) { @@ -99,7 +105,7 @@ int main(int argc, char *argv[]) { gettimeofday(&start_time, NULL); - for (i = 0; i < 10000000; i++) { + for (i = 0; i < msgcount; i++) { char message[1024]; size_t msglen; while (1) {