open-nomad/command/agent/util.go
2015-08-16 14:34:38 -07:00

12 lines
228 B
Go

package agent
import (
"math/rand"
"time"
)
// Returns a random stagger interval between 0 and the duration
func randomStagger(intv time.Duration) time.Duration {
return time.Duration(uint64(rand.Int63()) % uint64(intv))
}