X-Git-Url: http://p2p-next.cs.pub.ro/gitweb/?a=blobdiff_plain;f=sendfile%2Fclient%2Fclient.c;fp=sendfile%2Fclient%2Fclient.c;h=f5d93be6894c63613a3b148a78bb04b1c45c2242;hb=f1d5f09dd86dfbbe34b8d915f150d68ed779f146;hp=572f9cdf221b92ee3a763e79980cedf306e610c3;hpb=ffc95a7b6a0262d74247e8fac336896c7529fd63;p=p2p-kernel-protocol.git diff --git a/sendfile/client/client.c b/sendfile/client/client.c index 572f9cd..f5d93be 100644 --- a/sendfile/client/client.c +++ b/sendfile/client/client.c @@ -5,8 +5,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -22,6 +24,8 @@ int main(int argc, char **argv) { int fd[MAX_NUMBER_OF_PEERS]; int peers[MAX_NUMBER_OF_PEERS]; int i = 0, total, sent_size; + struct timeval start; + struct timeval stop; if (argc < 4 || argc % 2) { printf("Usage: %s " @@ -82,6 +86,7 @@ int main(int argc, char **argv) { total = i; + gettimeofday(&start, NULL); do { sent_size = 0; @@ -94,6 +99,10 @@ int main(int argc, char **argv) { usleep(20); } } while(sent_size); + gettimeofday(&stop, NULL); + + printf("Successfully written %s in %ld seconds\n", file_name, + stop.tv_sec - start.tv_sec); return 0; }