sleep generates a random sleep duration between 3 and 25 milliseconds and pauses the execution for that duration.
()
| 258 | |
| 259 | // sleep generates a random sleep duration between 3 and 25 milliseconds and pauses the execution for that duration. |
| 260 | func 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 | |
| 267 | func delay(l *zerolog.Logger) { |
| 268 | var n uint64 |