Jump to content
  • 0

Why?


MarioRossi93i

Question

	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.
	

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

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.

Link to comment
Share on other sites

  • Administrators
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.

Link to comment
Share on other sites

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.