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

Function Duration

ast/ast.go:330–332  ·  view source on GitHub ↗

Duration constructs a duration constant from nanoseconds. Positive values represent forward durations, negative values represent backward durations.

(nanos int64)

Source from the content-addressed store, hash-verified

328// Duration constructs a duration constant from nanoseconds.
329// Positive values represent forward durations, negative values represent backward durations.
330func Duration(nanos int64) Constant {
331 return Constant{DurationType, "", nanos, nil, nil}
332}
333
334// Pair constructs a pair constant. Parts can only be accessed in transforms.
335func pair(tpe ConstantType, fst, snd *Constant) Constant {

Callers 15

TestDurationLessThanFunction · 0.92
TestDurationGreaterThanFunction · 0.92
TestTimeAddFunction · 0.92
TestTimeSubFunction · 0.92
TestDurationAddFunction · 0.92
TestDurationMultFunction · 0.92
TestDurationComponentsFunction · 0.92
TestDurationFromUnitsFunction · 0.92

Calls

no outgoing calls

Tested by 15

TestDurationLessThanFunction · 0.74
TestDurationGreaterThanFunction · 0.74
TestTimeAddFunction · 0.74
TestTimeSubFunction · 0.74
TestDurationAddFunction · 0.74
TestDurationMultFunction · 0.74
TestDurationComponentsFunction · 0.74
TestDurationFromUnitsFunction · 0.74