Skip to content

The only tool you need to know what is happening and how to fix it.

256 B
Raw Blame
package main

import (
	"math/rand/v2"
	"time"
)

func fastPath() bool {
	return rand.IntN(4) == 0
}

func slowJitter(minMs, maxMs int) {
	d := minMs
	if maxMs > minMs {
		d += rand.IntN(maxMs - minMs)
	}
	time.Sleep(time.Duration(d) * time.Millisecond)
}