From 65c2326592b7b1496c468459689904843e443b26 Mon Sep 17 00:00:00 2001 From: Timo Dritschler Date: Thu, 20 Nov 2014 17:37:55 +0100 Subject: Release KIRO to GitHub under LGPL v2.1 Added kiro_*_free methods to all three units Added installation guide Added readme Added licence file --- test/test-client-bandwidth.c | 54 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 test/test-client-bandwidth.c (limited to 'test/test-client-bandwidth.c') diff --git a/test/test-client-bandwidth.c b/test/test-client-bandwidth.c new file mode 100644 index 0000000..8cf87d5 --- /dev/null +++ b/test/test-client-bandwidth.c @@ -0,0 +1,54 @@ +#include +#include +#include +#include "kiro-client.h" +#include "kiro-trb.h" +#include + + +int +main ( int argc, char *argv[] ) +{ + if (argc < 3) { + printf ("Not enough aruments. Usage: ./client
\n"); + return -1; + } + + KiroClient *client = kiro_client_new (); + + if (-1 == kiro_client_connect (client, argv[1], argv[2])) { + kiro_client_free (client); + return -1; + } + + kiro_client_sync (client); + KiroTrb *trb = kiro_trb_new (); + kiro_trb_adopt (trb, kiro_client_get_memory (client)); + + GTimer *timer = g_timer_new (); + + +while (1) { + int i = 0; + while(i < 500) { + kiro_client_sync (client); + i++; + } + + double elapsed = g_timer_elapsed (timer, NULL); + size_t size = kiro_client_get_memory_size (client); + printf ("Throughput: %.2fGbyte/s\n",((size * 500) / elapsed)/(1024*1024*1024)); +} + g_timer_stop (timer); + kiro_client_free (client); + kiro_trb_free (client); + return 0; +} + + + + + + + + -- cgit v1.2.3