repr.go 249 B

1234567891011
  1. package timex
  2. import (
  3. "fmt"
  4. "time"
  5. )
  6. // ReprOfDuration returns the string representation of given duration in ms.
  7. func ReprOfDuration(duration time.Duration) string {
  8. return fmt.Sprintf("%.1fms", float32(duration)/float32(time.Millisecond))
  9. }