提交 583371af 编写于 作者: N Nicolas Pitre 提交者: Junio C Hamano

change throughput display units with fast links

Switch to MiB/s when the connection is fast enough (i.e. on a LAN).
Signed-off-by: NNicolas Pitre <nico@fluxnic.net>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 d01a8e32
......@@ -131,7 +131,13 @@ static void throughput_string(struct throughput *tp, off_t total,
} else {
l -= snprintf(tp->display, l, ", %u bytes", (int)total);
}
if (rate)
if (rate > 1 << 10) {
int x = rate + 5; /* for rounding */
snprintf(tp->display + sizeof(tp->display) - l, l,
" | %u.%2.2u MiB/s",
x >> 10, ((x & ((1 << 10) - 1)) * 100) >> 10);
} else if (rate)
snprintf(tp->display + sizeof(tp->display) - l, l,
" | %u KiB/s", rate);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册