add timer and warning

This commit is contained in:
Thomas Rudin 2018-11-27 15:44:42 +01:00
parent df4e880d8b
commit 80429033aa
1 changed files with 7 additions and 0 deletions

View File

@ -63,6 +63,7 @@ minetest.register_globalstep(function (dtime)
-- don't even try if server has not been running for XY seconds; resumetime = time to wait
-- after starting the server before processing the ActionQueue, don't set this too low
if (m_time < resumetime) then return end
local t0 = minetest.get_us_time()
local actions = mesecon.tablecopy(mesecon.queue.actions)
local actions_now={}
@ -84,6 +85,12 @@ minetest.register_globalstep(function (dtime)
mesecon.queue:execute(actions_now[hp])
table.remove(actions_now, hp)
end
local t1 = minetest.get_us_time()
local diff = t1 - t0
if diff > 100000 then
minetest.log("warning", "[mesecons] globalstep took " .. diff .. " us")
end
end)
function mesecon.queue:execute(action)