If you have a way to distribute load across multiple ticks, please add it to this thread.
single modulo
Code: Select all
if game.tick % update_interval then
for k, sensor in pairs(global.Sensors ) do
Worker(sensor)
end
end
Con:
- no load distribution among ticks
Code: Select all
for k, sensor in pairs(global.Sensors ) do
if k % update_interval == game.tick % update_interval then
Worker(sensor)
end
end
- spreads load from Worker evenly across corresponding modulos
- works only with global.Sensors as array
unordered sets will break this method