made shutil's mem() act more like free

This commit is contained in:
Izaya 2017-08-03 17:53:36 +10:00
parent 0db4fdee01
commit b47fb83d73
1 changed files with 5 additions and 3 deletions

View File

@ -18,7 +18,9 @@ function ps(f)
end
end
function mem()
print("Total:\t"..tostring(math.floor(computer.totalMemory()/1024)).."K")
print("Free: \t"..tostring(math.floor(computer.freeMemory()/1024)).."K")
print("Used: \t"..tostring(math.floor((computer.totalMemory()-computer.freeMemory())/1024)).."K")
print(" \tTotal\tFree\tUsed")
io.write("Mem\t")
io.write(tostring(math.floor(computer.totalMemory()/1024)).."K\t")
io.write(tostring(math.floor(computer.freeMemory()/1024)).."K\t")
print(tostring(math.floor((computer.totalMemory()-computer.freeMemory())/1024)).."K\t")
end