int dropPack show

master
dustoair 3 years ago
parent 6ede7961a3
commit 8d08158929

@ -178,9 +178,9 @@ func foot(address string, icmp_seq int, dropPack, min_lan, avg_lan, max_lan floa
icmp_seq -= 1 //最后一个seq没统计过来
fmt.Printf("\n--- %s ping statistics ---\n", address)
if dropPack >= 1 {
fmt.Printf("%d packets transmitted, %f %s, %.2f%% packet loss, time 1000ms\n", icmp_seq, dropPack, red("lost"), dropPack/float64(icmp_seq)*100)
fmt.Printf("%d packets transmitted, %f %s, %.2f%% packet loss, time 1000ms\n", icmp_seq, int(dropPack), red("lost"), dropPack/float64(icmp_seq)*100)
} else {
fmt.Printf("%d packets transmitted, %f %s, %.2f%% packet loss, time 1000ms\n", icmp_seq, dropPack, green("lost"), dropPack/float64(icmp_seq)*100)
fmt.Printf("%d packets transmitted, %f %s, %.2f%% packet loss, time 1000ms\n", icmp_seq, int(dropPack), green("lost"), dropPack/float64(icmp_seq)*100)
}
if len(ret_list) == 0 {

Loading…
Cancel
Save