优化 TCPPing 延迟统计精度 (#76)

This commit is contained in:
葉鲜森(KEVI_) 2024-10-20 10:42:08 +08:00 committed by GitHub
parent 765f7d9c34
commit 134c8c5acb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -495,7 +495,7 @@ func handleTcpPingTask(task *pb.Task, result *pb.TaskResult) {
result.Data = err.Error()
} else {
conn.Close()
result.Delay = float32(time.Since(start).Milliseconds())
result.Delay = float32(time.Since(start).Microseconds()) / 1000.0
result.Successful = true
}
}