用随机抖动的时间缓冲?

2024-09-28 23:15:55 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用的是buffer_with_time,它接受关键字参数:

timespan – Length of each buffer (specified as an integer denoting milliseconds)

但是,时间戳是固定的。我想给它添加一个随机抖动。你知道吗

如果我的并行任务同时启动,那么固定的timespan=5000每五秒钟就会同时阻塞一次。如何使timespan更具动态性,比如5000±300ms,以便逐渐均匀地触发缓冲区事件?你知道吗


Tags: ofan参数timeasbufferwithinteger