Add profiling code to force_get_node()

This commit is contained in:
teknomunk 2024-08-07 21:32:45 -05:00
parent 72e90b91d2
commit 7eca91e4b9
1 changed files with 3 additions and 0 deletions

View File

@ -11,6 +11,7 @@ local function force_get_node(pos)
local node = minetest.get_node(pos) local node = minetest.get_node(pos)
if node.name ~= "ignore" then return node end if node.name ~= "ignore" then return node end
local time_start = minetest.get_us_time()
local vm = minetest.get_voxel_manip() local vm = minetest.get_voxel_manip()
local emin, emax = vm:read_from_map(pos, pos) local emin, emax = vm:read_from_map(pos, pos)
local area = VoxelArea:new{ local area = VoxelArea:new{
@ -22,11 +23,13 @@ local function force_get_node(pos)
local param2_data = vm:get_param2_data() local param2_data = vm:get_param2_data()
local vi = area:indexp(pos) local vi = area:indexp(pos)
minetest.log("force_get_node() voxel_manip section took "..((minetest.get_us_time()-time_start)*1e-6).." seconds")
return { return {
name = minetest.get_name_from_content_id(data[vi]), name = minetest.get_name_from_content_id(data[vi]),
param = param_data[vi], param = param_data[vi],
param2 = param2_data[vi] param2 = param2_data[vi]
} }
end end
function mcl_minecarts:get_sign(z) function mcl_minecarts:get_sign(z)