MCPcopy Index your code
hub / github.com/coder/coder / nextBoundary

Function nextBoundary

enterprise/coderd/usage/cron.go:211–215  ·  view source on GitHub ↗

nextBoundary returns the first multiple of interval (relative to epoch) that is strictly after t.

(t time.Time, interval time.Duration)

Source from the content-addressed store, hash-verified

209// nextBoundary returns the first multiple of interval (relative to
210// epoch) that is strictly after t.
211func nextBoundary(t time.Time, interval time.Duration) time.Time {
212 since := t.Sub(epoch)
213 n := since / interval
214 return epoch.Add((n + 1) * interval)
215}

Callers 2

TestNextBoundaryFunction · 0.85
nextTickFunction · 0.85

Calls 1

AddMethod · 0.65

Tested by 1

TestNextBoundaryFunction · 0.68