This commit is contained in:
Frank
2019-09-06 22:23:52 +02:00
parent 553f14d2ea
commit af3bf7dece
4 changed files with 161 additions and 202 deletions
+7 -2
View File
@@ -961,9 +961,14 @@ function UTILS.FileExists(file)
end
--- Checks the current memory usage collectgarbage("count"). Info is printed to the DCS log file. Time stamp is the current mission runtime.
function UTILS.CheckMemory()
-- @param #boolean output If true, print to DCS log file.
-- @return #number Memory usage in kByte.
function UTILS.CheckMemory(output)
local time=timer.getTime()
local clock=UTILS.SecondsToClock(time)
local mem=collectgarbage("count")
env.info(string.format("T=%s Memory usage %d kByte = %.2f MByte", clock, mem, mem/1024))
if output then
env.info(string.format("T=%s Memory usage %d kByte = %.2f MByte", clock, mem, mem/1024))
end
return mem
end