mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 19:47:47 +03:00
Removes chrono references to make it compile with gcc 4.8.x
This commit is contained in:
13
src/utils.cc
13
src/utils.cc
@@ -196,5 +196,18 @@ void createDir(std::string dir, int mode) {
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
double cpu_seconds(void) {
|
||||
struct timespec t;
|
||||
|
||||
if (!clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &t))
|
||||
return static_cast<double>(t.tv_sec)
|
||||
+ static_cast<double>(t.tv_nsec / 1000000000.0);
|
||||
else
|
||||
return static_cast<double>(clock()) /
|
||||
static_cast<double>(CLOCKS_PER_SEC);
|
||||
}
|
||||
|
||||
|
||||
} // namespace ModSecurity
|
||||
|
||||
|
Reference in New Issue
Block a user