Randomized schedule
Moderators: JRL, Dorian (MJT support)
Randomized schedule
Presently, scheduling can be fixed to a time. It would be nice to have an additional option associated with a scheduled time, which would allow for some degree of randomization of execution centered on the scheduled time--a field to enter a time "window" (in minutes +/-) for randomizing execution.
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
This is actually quite easy to do with a regular schedule and two simple lines of code.
Let's say you want to run a schedule at 12:00 +/- 5 mins. Here's what you can do:
1. Modify the macro by adding these lines to the top:
Random>601,randDelay
Wait>randDelay
2. Schedule the macro to start at 11:55.
Now, what will happen is that the schedule will fire at 5 minutes to 12. The macro will then randomly decide a delay of between 0 and 600 seconds. I.e. somewhere between 0 and 10 minutes. It will wait that amount and then continue to do it's stuff.
The upshot is that you have a macro which runs sometime between 11.55 and 12.05.
Let's say you want to run a schedule at 12:00 +/- 5 mins. Here's what you can do:
1. Modify the macro by adding these lines to the top:
Random>601,randDelay
Wait>randDelay
2. Schedule the macro to start at 11:55.
Now, what will happen is that the schedule will fire at 5 minutes to 12. The macro will then randomly decide a delay of between 0 and 600 seconds. I.e. somewhere between 0 and 10 minutes. It will wait that amount and then continue to do it's stuff.
The upshot is that you have a macro which runs sometime between 11.55 and 12.05.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?