1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Mod profiling support

Config settings:
profiling = true/false (gather statistics)
detailed_profiling = true/false (break mod times to callbacks)

Chat commands:
save_mod_profile saves current statistics in debug.txt and shows on console (on default loglevel)
This commit is contained in:
sapier 2014-08-12 23:07:27 +02:00
parent 4caa00cc99
commit c24e0753fc
7 changed files with 391 additions and 0 deletions

View file

@ -797,6 +797,13 @@ int ModApiEnvMod::l_forceload_free_block(lua_State *L)
return 0;
}
// get_us_time()
int ModApiEnvMod::l_get_us_time(lua_State *L)
{
lua_pushnumber(L, porting::getTimeUs());
return 1;
}
void ModApiEnvMod::Initialize(lua_State *L, int top)
{
API_FCT(set_node);
@ -834,4 +841,5 @@ void ModApiEnvMod::Initialize(lua_State *L, int top)
API_FCT(transforming_liquid_add);
API_FCT(forceload_block);
API_FCT(forceload_free_block);
API_FCT(get_us_time);
}