MCPcopy Create free account
hub / github.com/defold/defold / EnableProfiler

Function EnableProfiler

engine/profiler/src/profiler.cpp:434–445  ·  view source on GitHub ↗

enables or disables the in-game profiler data collection * * The profiler is a real-time tool that shows the numbers of milliseconds spent * in each scope per frame as well as counters. The profiler is very useful for * tracking down performance and resource problems. * * @name profiler.enable * @param enabled [type:boolean] true to enable, false to disable * * @examples * ```lua * -- S

Source from the content-addressed store, hash-verified

432 * ```
433 */
434static int EnableProfiler(lua_State* L)
435{
436 DM_LUA_STACK_CHECK(L, 0);
437
438 if (!lua_isboolean(L, 1))
439 {
440 return DM_LUA_ERROR("Invalid parameter, expected a boolean but got a %s", lua_typename(L, lua_type(L, 1)))
441 }
442
443 dmProfiler::SetEnabled(lua_toboolean(L, 1));
444 return 0;
445}
446
447/*# enables or disables the on-screen profiler ui
448 * Creates and shows or hides and destroys the on-sceen profiler ui

Callers

nothing calls this directly

Calls 4

lua_typenameFunction · 0.85
lua_typeFunction · 0.85
lua_tobooleanFunction · 0.85
SetEnabledFunction · 0.70

Tested by

no test coverage detected