Skip to content

Commit 18aa9e7

Browse files
committed
Removed execution time logging
1 parent 0a226c5 commit 18aa9e7

File tree

1 file changed

+12
-17
lines changed

1 file changed

+12
-17
lines changed

source/async_postgres.hpp

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,18 @@ namespace GLua = GarrysMod::Lua;
2323
reinterpret_cast<GLua::ILuaInterface*>(L->luabase); \
2424
L->luabase->SetState(L)
2525

26-
#define lua_protected_fn(name) \
27-
int name##__Imp(GLua::ILuaInterface* lua); \
28-
int name(lua_State* L) { \
29-
auto lua = lua_interface(); \
30-
const auto start = std::chrono::high_resolution_clock::now(); \
31-
try { \
32-
int ret = name##__Imp(lua); \
33-
const auto end = std::chrono::high_resolution_clock::now(); \
34-
const std::chrono::duration<double, std::milli> dur = end - start; \
35-
if (dur.count() > 1) \
36-
lua->Msg(#name " execution time: %.2fms\n", dur.count()); \
37-
return ret; \
38-
} catch (const std::exception& e) { \
39-
lua->ThrowError(e.what()); \
40-
return 0; \
41-
} \
42-
} \
26+
#define lua_protected_fn(name) \
27+
int name##__Imp(GLua::ILuaInterface* lua); \
28+
int name(lua_State* L) { \
29+
auto lua = lua_interface(); \
30+
try { \
31+
int ret = name##__Imp(lua); \
32+
return ret; \
33+
} catch (const std::exception& e) { \
34+
lua->ThrowError(e.what()); \
35+
return 0; \
36+
} \
37+
} \
4338
int name##__Imp([[maybe_unused]] GarrysMod::Lua::ILuaInterface* lua)
4439

4540
namespace async_postgres {

0 commit comments

Comments
 (0)