local times={} local total=0 local ngs=0 minetest.register_on_mods_loaded(function() for i, gs in ipairs(minetest.registered_globalsteps) do local info = minetest.callback_origins[gs] local n=info.mod if n == mesecons minetest.registered_globalsteps[i]=function(dtime) local t1=os.clock() local r=gs(dtime) local t2=os.clock() times[n]=os.clock()-t1 total=total+times[n] return r end end end) minetest.register_chatcommand("gsp",{privs={debug=true}, description="Give an overview of the registered globalsteps and how long they each take", func=function(p) table.sort(times) minetest.chat_send_player(p,"times:"..dump(times)) minetest.chat_send_player(p,"total globalstep time last interval:"..dump(total)) minetest.chat_send_player(p,"total globalsteps registered:"..dump(ngs)) end})