文章来源
https://blog.csdn.net/caohongxing/article/details/83025223
如需要每个线程在请求前按随机时间停顿,那么使用这个定时器,上图表示暂停时间会分布在100到400之间,计算公式参考:Math.abs((this.random.nextGaussian() * 300) + 100)
传送门(什么是高斯随机分布):https://zhidao.baidu.com/question/89318504.html
下面这个例子中,高斯随机定时器的偏差为1000ms,固定延迟偏移为3000ms
,执行结果如下: