open-nomad/command/agent/util.go

12 lines
228 B
Go
Raw Normal View History

2015-08-16 21:34:38 +00:00
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))
}