MCPcopy Create free account
hub / github.com/Azure/peerd / sleep

Function sleep

tests/random/random.go:260–265  ·  view source on GitHub ↗

sleep generates a random sleep duration between 3 and 25 milliseconds and pauses the execution for that duration.

()

Source from the content-addressed store, hash-verified

258
259// sleep generates a random sleep duration between 3 and 25 milliseconds and pauses the execution for that duration.
260func sleep() {
261 var n int64
262 _ = binary.Read(rand.Reader, binary.LittleEndian, &n)
263 n = (n%(25-3+1) + 3)
264 time.Sleep(time.Duration(n) * time.Millisecond)
265}
266
267func delay(l *zerolog.Logger) {
268 var n uint64

Callers 1

downloadSASURLFunction · 0.70

Calls 1

ReadMethod · 0.65

Tested by

no test coverage detected