Skip to content

Commit

Permalink
commit patches sent in by Radek. refs #443
Browse files Browse the repository at this point in the history
  • Loading branch information
synfinatic committed Aug 21, 2010
1 parent 8619602 commit 42722b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/common/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,14 @@ packet_stats(struct timeval *begin, struct timeval *end,
if (timerisset(&diff)) {
if (bytes_sent){
bytes_sec = bytes_sent / frac_sec;
mb_sec = (bytes_sec * 8) / (1024 * 1024);
mb_sec = (bytes_sec * 8) / (1000 * 1000);
}
if (pkts_sent)
pkts_sec = pkts_sent / frac_sec;
}
printf("Actual: " COUNTER_SPEC " packets (" COUNTER_SPEC " bytes) sent in %.02f seconds.",
printf("Actual: " COUNTER_SPEC " packets (" COUNTER_SPEC " bytes) sent in %.02f seconds.\n",
pkts_sent, bytes_sent, frac_sec);
printf("\t\tRated: %.1f bps, %.2f Mbps, %.2f pps\n",
printf("Rated: %.1f Bps, %.2f Mbps, %.2f pps\n",
bytes_sec, mb_sec, pkts_sec);

if (failed)
Expand Down
2 changes: 1 addition & 1 deletion src/send_packets.c
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ do_sleep(struct timeval *time, struct timeval *last, int len, int accurate,
* a constant 'rate' (bytes per second).
*/
if (pkts_sent != 0) {
n = (float)len / (options.speed.speed * 1024 * 1024 / 8); /* convert Mbps to bps */
n = (float)len / (options.speed.speed * 1000 * 1000 / 8); /* convert Mbps to bps */
nap.tv_sec = n;
nap.tv_nsec = (n - nap.tv_sec) * 1000000000;

Expand Down

0 comments on commit 42722b8

Please sign in to comment.