Jump to content
  • 0

Why?


MarioRossi93i

Question

Posted

	start = os.time()
timeout = 1
stop = start + timeout
f = 0
m = {}
while stop > os.time() do
    m[f] = 'Iter N. '..f
    f = f + 1
end
print(m)
os.exit() 
	

Output:

	Script terminato:
    [75781] = 'Iter N. 75781',
    [75782] = 'Iter N. 75782',
    [75783] = 'Iter N. 75783',
    ***
    [85140] = 'Iter N. 85140',
    [85141] = 'Iter N. 85141',
    [    0] = 'Iter N. 0',
}
	Uscita.
	

6 answers to this question

Recommended Posts

Posted

If you want to read fully. Use

start = os.time()
timeout = 1
stop = start + timeout
f = 0
m = "";
while stop > os.time() do
  	m = m .. "Iter N. ".. f .. "\n"
    f = f + 1
end
io.open("/sdcard/Download/Output.lua","w"):write(m) 
os.exit() 
	

this can get full content with no text limit.

  • Administrators
Posted
3 minutes ago, ItsSC said:

tostirng(m)

Can simply ended OOM.

Better write line by line directly to file, instead of store in table. It is very expensive and eat a lot of memory.

[added 4 minutes later]

gg.saveVariable also better suit for this because especially optimized for work with huge tables without OOM.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.