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

Function CallbackCounter

engine/script/src/test/test_script_timer.cpp:713–723  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

711static float cb_elapsed_time = 0.0f;
712
713static int CallbackCounter(lua_State* L)
714{
715 int top = lua_gettop(L);
716 const int handle = luaL_checkint(L, 1);
717 const double dt = luaL_checknumber(L, 2);
718 cb_callback_handle = (dmScript::HTimer)handle;
719 cb_elapsed_time += dt;
720 ++cb_callback_counter;
721 assert(top == lua_gettop(L));
722 return 0;
723}
724
725static const luaL_reg Module_methods[] = {
726 { "callback_counter", CallbackCounter},

Callers

nothing calls this directly

Calls 3

lua_gettopFunction · 0.85
luaL_checknumberFunction · 0.85
assertFunction · 0.50

Tested by

no test coverage detected