MCPcopy
hub / github.com/google/mangle / FormatDuration

Function FormatDuration

ast/ast.go:104–108  ·  view source on GitHub ↗

FormatDuration formats a duration (nanoseconds) as a human-readable string. Uses the most appropriate unit: ns, us, ms, s, m, h, or combinations.

(nanos int64)

Source from the content-addressed store, hash-verified

102// FormatDuration formats a duration (nanoseconds) as a human-readable string.
103// Uses the most appropriate unit: ns, us, ms, s, m, h, or combinations.
104func FormatDuration(nanos int64) string {
105 d := time.Duration(nanos)
106 // Use Go's standard duration formatting for precision
107 return d.String()
108}
109
110// Term represents the building blocks of datalog programs, namely constants, variables, atoms,
111// and also negated atoms, equality and inequality.

Callers 2

StringMethod · 0.85
DisplayStringMethod · 0.85

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected