From 63f3f2fd8b61ba7234401dd1f2bae892375a3acc Mon Sep 17 00:00:00 2001 From: Felipe Zimmerle Date: Tue, 27 Dec 2016 20:51:50 -0300 Subject: [PATCH] Avoids unnecessary elapsed time calculations --- src/rule.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/rule.cc b/src/rule.cc index 440c22a7..49991597 100644 --- a/src/rule.cc +++ b/src/rule.cc @@ -256,9 +256,11 @@ void Rule::executeActionsIndependentOfChainedRuleResult(Transaction *trasn, bool Rule::executeOperatorAt(Transaction *trasn, std::string key, std::string value) { +#if MSC_EXEC_CLOCK_ENABLED clock_t begin = clock(); clock_t end; double elapsed_s = 0; +#endif bool ret; trasn->debug(9, "Target value: \"" + utils::string::limitTo(80, @@ -270,12 +272,13 @@ bool Rule::executeOperatorAt(Transaction *trasn, std::string key, return false; } +#if MSC_EXEC_CLOCK_ENABLED end = clock(); elapsed_s = static_cast(end - begin) / CLOCKS_PER_SEC; trasn->debug(4, "Operator completed in " + \ std::to_string(elapsed_s) + " seconds"); - +#endif return ret; }