Removes chrono references to make it compile with gcc 4.8.x

This commit is contained in:
Felipe Zimmerle
2015-07-31 15:49:28 -03:00
parent 933ade596c
commit a4cf218a3e
6 changed files with 21 additions and 8 deletions

View File

@@ -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