MakeDuration returns a Duration rounded to the nearest microsecond.
(nanos, days, months int64)
| 96 | |
| 97 | // MakeDuration returns a Duration rounded to the nearest microsecond. |
| 98 | func 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. |
| 107 | func DecodeDuration(months, days, nanos int64) Duration { |
no test coverage detected
searching dependent graphs…