diff --git a/zone/command.cpp b/zone/command.cpp index 5d9cfe942..0171aaa7c 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #ifdef _WINDOWS #define strcasecmp _stricmp @@ -428,7 +429,8 @@ int command_init(void) { command_add("open_shop", nullptr, 100, command_merchantopenshop) || command_add("merchant_close_shop", "Closes a merchant shop", 100, command_merchantcloseshop) || command_add("close_shop", nullptr, 100, command_merchantcloseshop) || - command_add("shownumhits", "Shows buffs numhits for yourself.", 0, command_shownumhits) + command_add("shownumhits", "Shows buffs numhits for yourself.", 0, command_shownumhits) || + command_add("logtest", "Performs log performance testing.", 250, command_logtest) ) { command_deinit(); @@ -10665,3 +10667,13 @@ void command_shownumhits(Client *c, const Seperator *sep) c->ShowNumHits(); return; } + +void command_logtest(Client *c, const Seperator *sep){ + clock_t t = std::clock(); /* Function timer start */ + if (sep->IsNumber(1)){ + uint32 i = 0; + for (i = 0; i < atoi(sep->arg[1]); i++){ + logger.LogDebug(EQEmuLogSys::General, "[%u] Test... Took %f seconds", i, ((float)(std::clock() - t)) / CLOCKS_PER_SEC); + } + } +} \ No newline at end of file diff --git a/zone/command.h b/zone/command.h index 68e956166..088c83510 100644 --- a/zone/command.h +++ b/zone/command.h @@ -326,6 +326,7 @@ void command_npctype_cache(Client *c, const Seperator *sep); void command_merchantopenshop(Client *c, const Seperator *sep); void command_merchantcloseshop(Client *c, const Seperator *sep); void command_shownumhits(Client *c, const Seperator *sep); +void command_logtest(Client *c, const Seperator *sep); #ifdef EQPROFILE void command_profiledump(Client *c, const Seperator *sep);