MCPcopy Index your code
hub / github.com/uber-go/zap / SecondsDurationEncoder

Function SecondsDurationEncoder

zapcore/encoder.go:234–236  ·  view source on GitHub ↗

SecondsDurationEncoder serializes a time.Duration to a floating-point number of seconds elapsed.

(d time.Duration, enc PrimitiveArrayEncoder)

Source from the content-addressed store, hash-verified

232
233// SecondsDurationEncoder serializes a time.Duration to a floating-point number of seconds elapsed.
234func SecondsDurationEncoder(d time.Duration, enc PrimitiveArrayEncoder) {
235 enc.AppendFloat64(float64(d) / float64(time.Second))
236}
237
238// NanosDurationEncoder serializes a time.Duration to an integer number of
239// nanoseconds elapsed.

Callers

nothing calls this directly

Calls 1

AppendFloat64Method · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…