MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / MakeDuration

Function MakeDuration

pkg/util/duration/duration.go:98–104  ·  view source on GitHub ↗

MakeDuration returns a Duration rounded to the nearest microsecond.

(nanos, days, months int64)

Source from the content-addressed store, hash-verified

96
97// MakeDuration returns a Duration rounded to the nearest microsecond.
98func MakeDuration(nanos, days, months int64) Duration {
99 return Duration{
100 Months: months,
101 Days: days,
102 nanos: rounded(nanos),
103 }
104}
105
106// DecodeDuration returns a Duration without rounding nanos.
107func DecodeDuration(months, days, nanos int64) Duration {

Callers 12

interval.goFile · 0.92
sqlStdToDurationFunction · 0.92
parseShortDurationMethod · 0.92
datum.goFile · 0.92
eval.goFile · 0.92
PerformCastFunction · 0.92
DifferenceFunction · 0.92
AddMethod · 0.85
SubMethod · 0.85
MulMethod · 0.85
MulFloatMethod · 0.85
DivFloatMethod · 0.85

Calls 1

roundedFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…