mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-23 09:00:20 +08:00
12 lines
249 B
Go
12 lines
249 B
Go
package timex
|
|
|
|
import (
|
|
"fmt"
|
|
"time"
|
|
)
|
|
|
|
// ReprOfDuration returns the string representation of given duration in ms.
|
|
func ReprOfDuration(duration time.Duration) string {
|
|
return fmt.Sprintf("%.1fms", float32(duration)/float32(time.Millisecond))
|
|
}
|