MCPcopy Index your code
hub / github.com/APIParkLab/APIPark / FormatTime

Function FormatTime

common/format.go:38–52  ·  view source on GitHub ↗
(t int64)

Source from the content-addressed store, hash-verified

36}
37
38func FormatTime(t int64) string {
39 if t < 1000 {
40 return strconv.FormatInt(t, 10) + "ms"
41 }
42 if t < 1000000 {
43 return fmt.Sprintf("%.1fs", float64(t)/1000)
44 }
45 if t < 1000000000 {
46 return fmt.Sprintf("%.1fmin", float64(t)/1000000)
47 }
48 if t < 1000000000000 {
49 return fmt.Sprintf("%.1fhour", float64(t)/1000000000)
50 }
51 return fmt.Sprintf("%.1D", float64(t)/1000000000000)
52}
53
54func FormatByte(b int64) string {
55 const (

Callers 2

RestLogInfoMethod · 0.92
RestLogsMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected