MCPcopy Index your code
hub / github.com/git-bug/git-bug / applyJitter

Function applyJitter

internal/test/test.go:74–81  ·  view source on GitHub ↗
(d time.Duration, jitter float64)

Source from the content-addressed store, hash-verified

72}
73
74func applyJitter(d time.Duration, jitter float64) time.Duration {
75 if jitter == 0 {
76 return d
77 }
78 maxJitter := float64(d) * jitter
79 delta := maxJitter * (rand.Float64()*2 - 1)
80 return time.Duration(float64(d) + delta)
81}

Callers 1

RunMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected