mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-09 10:16:49 +00:00
OPS
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user