refactor(rtt): use proto Duration, add tests

This commit is contained in:
Pasha Sviderski
2026-04-20 11:36:44 +10:00
parent 8d023f5c53
commit 84990ad692
10 changed files with 387 additions and 144 deletions
+12
View File
@@ -0,0 +1,12 @@
package tui
import (
"fmt"
"math"
"time"
)
// FormatRTT formats a round-trip time duration as whole milliseconds, e.g. "140ms".
func FormatRTT(d time.Duration) string {
return fmt.Sprintf("%dms", int64(math.Round(float64(d)/float64(time.Millisecond))))
}