mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-15 23:55:03 +03:00
Avoids unnecessary elapsed time calculations
This commit is contained in:
parent
a7f465cf3a
commit
63f3f2fd8b
@ -256,9 +256,11 @@ void Rule::executeActionsIndependentOfChainedRuleResult(Transaction *trasn,
|
|||||||
|
|
||||||
bool Rule::executeOperatorAt(Transaction *trasn, std::string key,
|
bool Rule::executeOperatorAt(Transaction *trasn, std::string key,
|
||||||
std::string value) {
|
std::string value) {
|
||||||
|
#if MSC_EXEC_CLOCK_ENABLED
|
||||||
clock_t begin = clock();
|
clock_t begin = clock();
|
||||||
clock_t end;
|
clock_t end;
|
||||||
double elapsed_s = 0;
|
double elapsed_s = 0;
|
||||||
|
#endif
|
||||||
bool ret;
|
bool ret;
|
||||||
|
|
||||||
trasn->debug(9, "Target value: \"" + utils::string::limitTo(80,
|
trasn->debug(9, "Target value: \"" + utils::string::limitTo(80,
|
||||||
@ -270,12 +272,13 @@ bool Rule::executeOperatorAt(Transaction *trasn, std::string key,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if MSC_EXEC_CLOCK_ENABLED
|
||||||
end = clock();
|
end = clock();
|
||||||
elapsed_s = static_cast<double>(end - begin) / CLOCKS_PER_SEC;
|
elapsed_s = static_cast<double>(end - begin) / CLOCKS_PER_SEC;
|
||||||
|
|
||||||
trasn->debug(4, "Operator completed in " + \
|
trasn->debug(4, "Operator completed in " + \
|
||||||
std::to_string(elapsed_s) + " seconds");
|
std::to_string(elapsed_s) + " seconds");
|
||||||
|
#endif
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user