This commit is contained in:
1
2026-01-23 14:59:15 +00:00
parent 95055fe955
commit 53be2cb776
8 changed files with 129 additions and 121 deletions

View File

@@ -8,7 +8,10 @@ import (
func TcpPing(address string) (n int64, err error) {
s := time.Now()
tcpConn, err := net.Dial("tcp", address)
n = time.Now().Sub(s).Nanoseconds()
n = time.Now().Sub(s).Milliseconds()
if n == 0 {
n = 1
}
if err != nil {
return
}