mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 19:13:34 +00:00
13 lines
261 B
Go
13 lines
261 B
Go
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))))
|
|
}
|