Hello all!
I'm scripting a rather large game, but for one portion of it, I need to have a 'rounds' script running:
while true do local roundtime = 500 for i = roundtime, 0, -1 do if i == 0 then -- Do Stuff end
I'm trying to make my game as memory efficient as I can, and I've found that while true do scripts tend to add MB to the memory usage, this particular one by itself adds 50-75MB of memory on desktop computers.
Question - Is there a better way to utilize a 'rounds' script than while true do, that's more memory efficient?
Thanks!
You shouldn't worry about efficiency right now because a single loop does scarcely anything, if you are trying to use an alternative, try these.. 1,
for i = 1,100,1 do print(i) end
2.
local a = 0 repeat wait() print(a) a = a+1 until a > 99
3.
local a = 0 local function iterate() a = a + 1 print(a) if a > 99 then else iterate() end wait() end iterate()