On Fri, 05 May 2023 16:13:01 +1000, Mark Jamsek wrote:

> I found kn's attempted syntax intuitive though; it feels like a natural
> extension of the existing random and step syntax. I also assumed ~/15
> would run every 15 minutes starting with a random minute, and since
> discovering it didn't work like that, I've been carrying a simple patch
> that allows kn's syntax:
>
>   ~/15                random 15 minute intervals in [0, 59]
>   1~9/10              random 10 minute intervals in [1,59]

It does seem like people prefer the ~/step syntax over my own, which
is fine.

However, I'm unsure about the x~y/step syntax.  Personally, I think
it would be more natural to treat x~y/step like x-y/step and just
use a random offset in the interval [0,step-1].  Do you have a
use-case for the way your diff handles this or did it just follow
naturally from the random value being in num1?

Also, using the % operator with the random value results in modulo
bias, which we would like to avoid.  If we use a random offset based
on the step interval instead there is no need for the modulus.

 - todd

Reply via email to