diff --git a/main.c b/main.c index 4613c96..83d00aa 100644 --- a/main.c +++ b/main.c @@ -339,10 +339,18 @@ static void output_summary(void) if (INFO_GTE(STATS, 1)) { rprintf(FCLIENT, "\n"); - rprintf(FINFO, - "sent %s bytes received %s bytes %s bytes/sec\n", - human_num(total_written), human_num(total_read), - human_dnum((total_written + total_read)/(0.5 + (endtime - starttime)), 2)); + /** time() may have returned -1 so only indicate bytes/sec + * if it could be calculated */ + if ((starttime != -1) && (endtime != -1)) { + rprintf(FINFO, + "sent %s bytes received %s bytes %s bytes/sec\n", + human_num(total_written), human_num(total_read), + human_dnum((total_written + total_read)/(0.5 + (endtime - starttime)), 2)); + } else { + rprintf(FINFO, + "sent %s bytes received %s bytes unknown bytes/sec\n", + human_num(total_written), human_num(total_read)); + } rprintf(FINFO, "total size is %s speedup is %s%s\n", human_num(stats.total_size), comma_dnum((double)stats.total_size / (total_written+total_read), 2),