diff options
author | Calvin Morrison <mutantturkey@gmail.com> | 2014-11-07 13:34:13 -0500 |
---|---|---|
committer | Calvin Morrison <mutantturkey@gmail.com> | 2014-11-07 13:34:13 -0500 |
commit | 1bf4af391943fa1f822931d2e1def77f2708feda (patch) | |
tree | 3b10146f5badebe1f6d807a11415dd7a15470d29 | |
parent | 068aee6c4ee553f7774ef02e51ee7f125baa98de (diff) |
use more clear up/down markers
-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); } |