mirror of
https://gitee.com/openharmony/third_party_benchmark
synced 2024-11-23 07:20:12 +00:00
Fix compilation for Android (#816)
Android doesn't support `getloadavg`
This commit is contained in:
parent
33d4404650
commit
b988639f31
@ -658,9 +658,9 @@ double GetCPUCyclesPerSecond() {
|
||||
}
|
||||
|
||||
std::vector<double> GetLoadAvg() {
|
||||
#if defined BENCHMARK_OS_FREEBSD || defined(BENCHMARK_OS_LINUX) || \
|
||||
#if (defined BENCHMARK_OS_FREEBSD || defined(BENCHMARK_OS_LINUX) || \
|
||||
defined BENCHMARK_OS_MACOSX || defined BENCHMARK_OS_NETBSD || \
|
||||
defined BENCHMARK_OS_OPENBSD
|
||||
defined BENCHMARK_OS_OPENBSD) && !defined(__ANDROID__)
|
||||
constexpr int kMaxSamples = 3;
|
||||
std::vector<double> res(kMaxSamples, 0.0);
|
||||
const int nelem = getloadavg(res.data(), kMaxSamples);
|
||||
|
Loading…
Reference in New Issue
Block a user