static int WriteLog(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(TimeCostLog), typeof(string))) { TimeCostLog obj = (TimeCostLog)ToLua.ToObject(L, 1); string arg0 = ToLua.ToString(L, 2); obj.WriteLog(arg0); return(0); } else if (count == 4 && TypeChecker.CheckTypes(L, 1, typeof(TimeCostLog), typeof(uint), typeof(eTimeCost), typeof(bool))) { TimeCostLog obj = (TimeCostLog)ToLua.ToObject(L, 1); uint arg0 = (uint)LuaDLL.lua_tonumber(L, 2); eTimeCost arg1 = (eTimeCost)ToLua.ToObject(L, 3); bool arg2 = LuaDLL.lua_toboolean(L, 4); obj.WriteLog(arg0, arg1, arg2); return(0); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to method: TimeCostLog.WriteLog")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int WiriteLog(IntPtr L) { try { ToLua.CheckArgsCount(L, 3); TimeCostLog obj = (TimeCostLog)ToLua.CheckObject(L, 1, typeof(TimeCostLog)); eTimeCost arg0 = (eTimeCost)ToLua.CheckObject(L, 2, typeof(eTimeCost)); bool arg1 = LuaDLL.luaL_checkboolean(L, 3); obj.WiriteLog(arg0, arg1); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
public void WiriteLog(eTimeCost e, bool begin = true) { if (!m_bRecord) { return; } if (!timeRecord.ContainsKey((int)e)) { timeRecord[(int)e] = new TimeCostInfo(); } TimeCostInfo tc = timeRecord[(int)e]; if (begin) { tc.beginTime = Time.realtimeSinceStartup; } else { tc.num++; tc.times += Time.realtimeSinceStartup - tc.beginTime; } }
public void WriteLog(uint sceneid, eTimeCost e, bool begin = true) { int id = (int)sceneid << 16 | (int)e; if (!scnRecord.ContainsKey(id)) { scnRecord[id] = new SceneTimeInfo(); } SceneTimeInfo st = scnRecord[id]; st.key = e; st.scneid = (int)sceneid; if (begin) { st.beginTime = Time.realtimeSinceStartup; } else { st.endTime = Time.realtimeSinceStartup; st.times += (st.endTime - st.beginTime); st.num++; } }