From b16677c824bf89e15521a0ebadd4bffcaf548039 Mon Sep 17 00:00:00 2001 From: Steven Danna Date: Fri, 10 Oct 2025 09:51:03 +0100 Subject: [PATCH] crtime: add (Mono).Add --- crtime/monotonic.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crtime/monotonic.go b/crtime/monotonic.go index 7f088da..8ddb110 100644 --- a/crtime/monotonic.go +++ b/crtime/monotonic.go @@ -39,6 +39,11 @@ func (m Mono) Sub(other Mono) time.Duration { return time.Duration(m - other) } +// Add returns the moment m+d. +func (m Mono) Add(d time.Duration) Mono { + return m + Mono(d) +} + // Elapsed returns the duration that elapsed since m. func (m Mono) Elapsed() time.Duration { return time.Duration(NowMono() - m)