MCPcopy
hub / github.com/uber-go/zap / MillisDurationEncoder

Function MillisDurationEncoder

zapcore/encoder.go:246–248  ·  view source on GitHub ↗

MillisDurationEncoder serializes a time.Duration to an integer number of milliseconds elapsed.

(d time.Duration, enc PrimitiveArrayEncoder)

Source from the content-addressed store, hash-verified

244// MillisDurationEncoder serializes a time.Duration to an integer number of
245// milliseconds elapsed.
246func MillisDurationEncoder(d time.Duration, enc PrimitiveArrayEncoder) {
247 enc.AppendInt64(d.Nanoseconds() / 1e6)
248}
249
250// StringDurationEncoder serializes a time.Duration using its built-in String
251// method.

Callers

nothing calls this directly

Calls 1

AppendInt64Method · 0.65

Tested by

no test coverage detected