fix to get CPU frequency on Linux
Brought to you by:
lilyco
--- src/common.cpp (revision 458)
+++ src/common.cpp (working copy)
@@ -43,6 +43,7 @@
#include <cstring>
#include <cerrno>
#include <unistd.h></unistd.h></cerrno></cstring>
#include <mach mach_time.h=""></mach>
@@ -155,6 +156,35 @@
mach_timebase_info_data_t info;
mach_timebase_info(&info);
frequency = info.denom * 1000ULL / info.numer;
}
#endif
// Fall back to microsecond if the resolution is not high enough.