diff options
Diffstat (limited to 'fsbm.c')
-rw-r--r-- | fsbm.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -125,8 +125,9 @@ void print_stats() { tx_speed = (tx_bytes - interfaces[i].tx_bytes) / timeDelta; printf("%s (", interfaces[i].interface); + printf("d "); print_bps(rx_speed); - printf(", "); + printf(" u "); print_bps(tx_speed); printf(")\t"); @@ -170,7 +171,8 @@ int main(int argc, char **argv) { break; case 'd': // Magic numbers? fuck it that's not a magic number, that's a 'real' number. - interval = atoi(optarg) * 100000; + interval = strtol(optarg, (char **)NULL, 10); + interval = interval * 100000; break; case 'h': printf("USAGE: fsbm, -b specifies bits, -d sets interval in 10ths of seconds, 1 sec default\n"); @@ -195,6 +197,7 @@ int main(int argc, char **argv) { while (!q) { print_stats(); printf("\n"); + fflush(stdout); usleep(interval); } |