Danielle wrote:You must have a lot of accounts... anyway, just insert a
sleepms() function within the loop, that'll reset the clock cycles. It should be the
foreach loop causing the issues, since the
for loop is only looping 5 times.
Well, your code is correct, but probably you should add a bit longer sleep. The point is that if you just want to get rid of the warning you have an easyer way to do that:
set_script_option(SCRIPTOPT_NO_RUNAWAY);
But as written in POL Performance Guide "increasing the runaway treshold is just ignoring the problem, not fixing it", so disabling runaway detection is even worse. So... what you really should do is add a sleepms() in the loop, but not the shortest the possible, but the smartest the possible. You shouldn't just care to "reset the clock cycles", but to have your core, as Shini sayd, be able to achieve a real constant multi-threading
Now, how to choose a smart value? Well, I haven't so much experience about this because I still have to test my script on a live shard and "tune" them properly, but basically for you critical scripts you should find the right alchemy of sleepms and script priority. I saw newest stadard distro often uses sleepms(2) in this kind of script, probably it's a good setting which should give the core the time to switch to other script. Maybe sleepms(1) is a bit too short?
And finally.. a question to Shini (or whoever knows the answer): when you say "runned script cycles" do you mean instructions executed by the core all at once? I should't take it as the number of loops of the foreach, should I?