bug fix in printf info

should be 3 info rather than 2
This commit is contained in:
HappyZ 2017-01-26 15:14:38 -08:00
parent 281e95577f
commit d18c91e2db
6 changed files with 7 additions and 2 deletions

View File

@ -175,7 +175,10 @@ int main(int argc, char *argv[])
// end timing
gettimeofday(&t_end, NULL);
elapsedTime = (t_end.tv_sec - t_start.tv_sec) + (t_end.tv_usec - t_start.tv_usec) / 1000000.0;
printf("duration(s):%lf\nthroughput(bps):%lf\n", elapsedTime, total_bytes_sent * 8 / elapsedTime);
printf(
"sent(bytes):%d\nduration(s):%lf\nthroughput(bps):%lf\n",
total_bytes_sent, elapsedTime, total_bytes_sent * 8 / elapsedTime);
close(sockfd);
close(fd);

View File

@ -199,7 +199,9 @@ int main(int argc, char *argv[])
// end timing
gettimeofday(&t_end, NULL);
elapsedTime = (t_end.tv_sec - t_start.tv_sec) + (t_end.tv_usec - t_start.tv_usec) / 1000000.0;
printf("duration(s):%lf\nthroughput(bps):%lf\n", elapsedTime, total_bytes_sent * 8 / elapsedTime);
printf(
"sent(bytes):%d\nduration(s):%lf\nthroughput(bps):%lf\n",
total_bytes_sent, elapsedTime, total_bytes_sent * 8 / elapsedTime);
close(sockfd);
close(fd);