Skip to content

Commit a2e0a21

Browse files
authored
Merge pull request #26 from cockroachdb/ssd/add
crtime: add (Mono).Add
2 parents 2a49e18 + b16677c commit a2e0a21

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

crtime/monotonic.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ func (m Mono) Sub(other Mono) time.Duration {
3939
return time.Duration(m - other)
4040
}
4141

42+
// Add returns the moment m+d.
43+
func (m Mono) Add(d time.Duration) Mono {
44+
return m + Mono(d)
45+
}
46+
4247
// Elapsed returns the duration that elapsed since m.
4348
func (m Mono) Elapsed() time.Duration {
4449
return time.Duration(NowMono() - m)

0 commit comments

Comments
 (0)